Discuss Scratch
- Discussion Forums
- » Developing Scratch Extensions
- » Tip for testing, debugging and playing with ScratchX
- Jonathan50
- Scratcher
1000+ posts
Tip for testing, debugging and playing with ScratchX
Here is a tip to test ScratchX and see what works and what doesn't as well as debugging without having to add, commit, push to GitHub and wait for GitHub pages to update.
All you need to do is edit the extension locally, and then to test it open ScratchX and click ‘Open Editor’.
Then open your JavaScript console and copy the extension into the console and press enter/return.
To make changes simply type ‘ScratchExtensions.unregister(“extension name here’)” into the console and press enter. It needs to be spelt correctly and is case sensitive (uppercase and lowercase need to match with the extension). Then make changes and copy and paste it again. This should save time if you are making little changes and seeing what works. Ta-da!
All you need to do is edit the extension locally, and then to test it open ScratchX and click ‘Open Editor’.
Then open your JavaScript console and copy the extension into the console and press enter/return.
To make changes simply type ‘ScratchExtensions.unregister(“extension name here’)” into the console and press enter. It needs to be spelt correctly and is case sensitive (uppercase and lowercase need to match with the extension). Then make changes and copy and paste it again. This should save time if you are making little changes and seeing what works. Ta-da!
Not yet a Knight of the Mu Calculus.
- Mrcomputer1
- Scratcher
500+ posts
Tip for testing, debugging and playing with ScratchX
What about right clicking the load extension button to load from file?
My Profile / My User Page / My Talk Page
——————–
Progress bar to 1000+ Posts - Image might not be up to date
——————–
My browser / operating system: Windows NT 10.0 (Windows 11 - 22H2), Firefox 122.0b4
——————–
My ScratchX Extensions——–If you like this post, give me an internet!——–Sharp Scratch Mod
- Znapi
- Scratcher
500+ posts
Tip for testing, debugging and playing with ScratchX
I coded up a local server in Java to serve the extension fresh from my file system with every request(with no-cache headers to be safe), and a block that I can click to reload the extension in ScratchX.
Then, all I do to load the extension with a ScratchX link pointing to localhost, which gets auto completed by my browser. Then I just edit and save the extension, then click the reload block. No page reloads, no console, reloading takes like a tenth of a second, and any tests I set up in ScratchX stay there.
Then, all I do to load the extension with a ScratchX link pointing to localhost, which gets auto completed by my browser. Then I just edit and save the extension, then click the reload block. No page reloads, no console, reloading takes like a tenth of a second, and any tests I set up in ScratchX stay there.
Last edited by Znapi (Aug. 8, 2015 21:07:04)
- Jonathan50
- Scratcher
1000+ posts
Tip for testing, debugging and playing with ScratchX
Cool, but how does it work if it is not on *.github.io I coded up a local server in Java to serve the extension fresh from my file system with every request(with no-cache headers to be safe), and a block that I can click to reload the extension in ScratchX.
Then, all I do to load the extension with a ScratchX link pointing to localhost, which gets auto completed by my browser. Then I just edit and save the extension, then click the reload block. No page reloads, no console, reloading takes like a tenth of a second, and any tests I set up in ScratchX stay there.
Not yet a Knight of the Mu Calculus.
- Jonathan50
- Scratcher
1000+ posts
Tip for testing, debugging and playing with ScratchX
Ok What about right clicking the load extension button to load from file?
Not yet a Knight of the Mu Calculus.
- Znapi
- Scratcher
500+ posts
Tip for testing, debugging and playing with ScratchX
I don't think that rule is actually enforced. I'm not sure why they are telling us it is the only way to host an extension.Cool, but how does it work if it is not on *.github.io I coded up a local server in Java to serve the extension fresh from my file system with every request(with no-cache headers to be safe), and a block that I can click to reload the extension in ScratchX.
Then, all I do to load the extension with a ScratchX link pointing to localhost, which gets auto completed by my browser. Then I just edit and save the extension, then click the reload block. No page reloads, no console, reloading takes like a tenth of a second, and any tests I set up in ScratchX stay there.
- Jonathan50
- Scratcher
1000+ posts
Tip for testing, debugging and playing with ScratchX
Ok… I thought the extensions actually didn't work if they weren't. Hmm…..I don't think that rule is actually enforced. I'm not sure why they are telling us it is the only way to host an extension.Cool, but how does it work if it is not on *.github.io I coded up a local server in Java to serve the extension fresh from my file system with every request(with no-cache headers to be safe), and a block that I can click to reload the extension in ScratchX.
Then, all I do to load the extension with a ScratchX link pointing to localhost, which gets auto completed by my browser. Then I just edit and save the extension, then click the reload block. No page reloads, no console, reloading takes like a tenth of a second, and any tests I set up in ScratchX stay there.
Not yet a Knight of the Mu Calculus.
- Jonathan50
- Scratcher
1000+ posts
Tip for testing, debugging and playing with ScratchX
To add: along with this you can debug using your browser's Javascript console and that's how I read the error messages What about right clicking the load extension button to load from file?
Not yet a Knight of the Mu Calculus.
- Discussion Forums
- » Developing Scratch Extensions
- » Tip for testing, debugging and playing with ScratchX