I use the throttle value in a watch.json file to prevent projects from compiling at every edit.
To reload a project I edit the value, adding and deleting zeros from the end.
To make this as convenient as possible, i open the file in a Firefox Side View window along side the glitch editor.
The new “Refresh App on Changes” feature that defaults to unchecked, is a welcome enhancement, however there is still the need to reload the app as needed.
I would like to have a button to the right of “Show Your App” that will reload or reboot your app.
EDIT/Update: upon further usage, integrating this with the clear log button or an option to have the clear log button also reload the app would be perfect.
Perhaps a checkbox next to it that toggles on/off the restart function with clear.
Hey there,
I think it is useful, however, it is not necessary and essential.
You can possibly do that by integrating a button which calls a function, which restarts the process:
function restart() {
// Change the parameter to 0 to change the exit code to 0 (Note: default exit code is 0).
return process.exit(1);
}
The function above executes the Process#exit function, which exts the process and restarts it.
Happy Glitching!
1 Like
Thanks for the reply.
For the foreseeable future, my app won’t have a UI, so I don’t think that solution will help me.
Guess you can write an extension that will take your Glitch Token and project name and then, on clicking a button, request kill
path for your Glitch app.
1 Like
a bit too advanced for me atm
1 Like
what i do is just put a ;
at the beginning of my watch.json file, wait for it to error, then delete the ;
and it restarts just fine
Thanks to the kind efforts of jarvis394, I now have a handy restart button.
note for those new to userscripts:
To run the script you need to have a ‘userscripts’ addon for your browser.
There seem to be three widely available Greasemonkey, Tampermonkey and Viloentmonkey.
My Google-fu resulted in learning that Greasemonkey essentailly no longer functions since Firefox 57.
Viloentmonkey has some shady privacy policy wording with regards to personal data.
I installed Tampermonkey, installed the script and the restart button appeared with a page refresh, and it works as advertised.
Since this is a complete refresh of the project, it takes a bit longer than the edit of the watch.json file, but it has an added bonus of refreshing the project tree so any files created in script will now be visible.
Also, I’ll get a significant amount of pixels back since I was using Firefox’s side view to have my watch.json file perpetually available.
Thanks again jarvis
1 Like