-
Notifications
You must be signed in to change notification settings - Fork 327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What is the correct way of reloading scripts during development? #3079
Comments
I'm not sure I understand: why would you want to reload a script? What does that mean? You don't mean reloading a web page? |
@Cerberus-tm I write scripts by iteratively improving them. I need to run the script in the browser each time I make an edit to detect any mistakes I have made and see if my most recent changes had the intended effect. That way I know any mistakes are caused by the most recent changes.
Repeat steps 2-4 a few hundred times because I make many mistakes. In older firefox+GM versions reloading the page will also reload the script from disk. So I do mean reloading the web page, though that's just an implicit consequence of needing to reload the userscript. |
Scripts run at page load time. Reload the page. (Most scripts modify the page, there's no "re-run the script" without reloading the page to give it a fresh page to modify, anyway.) |
@arantius I do not mind reloading the page to reload the script and am not looking for this. How do I update the script? I think you are misunderstanding my question. I am using Sublime Text to edit my script and I am using NPM and Grunt to compile a How can I update the script which is stored in GM after editing it in a source code editor? |
How do people reload scripts while editing them? I have tried looking online and in the issues here but cannot figure out the proper way of doing it.
I am currently using Firefox 56 from 2017 to do development because it's the latest version which will reload local script files as I edit them (GM3.17). I have the build process copy the scripts into the
gm_scripts
and it generally works. This is however a horrific 'solution'. I must be missing something obvious which other developers are doing.What is the correct way to get a greasemonkey script to automatically reload during development when I edit it in an external file or when a file is generated from a build process?
The text was updated successfully, but these errors were encountered: