I'm working on a Greasemonkey userscript for a web app that needs configuration steps before I can actually test my userscript's functionality. So every time I reload the page – to refresh my userscript from the updated file –, I have to reconfigure the web app before testing. Needless to say, this gets old very quickly.
Is there a way to reload only the userscript, preferably from the userscript itself? I would want to e.g. bind the reload to a keyboard shortcut.
I thought that this must be a very common need, but I came up empty-handed when trying to find a solution.
Generally not feasible.
As one of the collaborators remarked on this issue in GreaseMonkey's GitHub repo, almost all scripts mutate the page in ways that makes repeated script execution problematic.
I overlooked this fact in my original question – my script does mutate the page in ways that makes repeated script execution problematic.
If you want to implement script reload, and you find a feasible method to do that: