The simple part:
โOn a similar note: is there a way to test the scripts without having to wait 4 seconds each time to install it?โ
Yes!
Make sure Greasemonkey 9.0 or later is installed.
Make sure you have an editor with GM. You can set this in GM options or open about: config and install greasemonkey.editor , for example D:\Program Files\TextPad\TextPad.exe , but any decent program editor should do it.
Now edit the script, open the GM Script -Manager and click the corresponding Edit button. Your editor should open with the correct file uploaded, and any changes you make will take effect immediately, every time you save the file.
Beware that changes made to the @require directives this way will still not take effect. That is, the new file will not be copied and not used. You still need to uninstall / reinstall in order to get @require changes.
"I was wondering if there was a way to show the script firebug and set a breakpoint. I would like to be able to run the scripts I'm working on in the end."
There is a new add-on, FireBugMonkey , which can help (I still have to try).
The discussion of how Firebug works well on GM scripts has been going on for over 4 years. Here is the last / current question in the Greasemonkey-Dev group .
In the near future, there is no way to execute GM scripts that use GM_ functions .
You can get around this, for parts of the code that donโt use such functions, by entering this code on the landing page where Firebug can see it.
For example, structure your code as follows:
function localMain () { console.log ("Hiya!"); }
Then in Firefox you can use unsafeWindow.localMain = localMain; to enter the code, Firebug will see it.
unsafeWindow.localMain(); runs the code from GM, localMain(); launches it from the Firebug console.
Remember that this method provides a route for malicious JavaScript (from the landing page) to gain elevated privileges and potentially pwn your system (one of the reasons GM was moved to the sandbox in the first place). But, itโs quick and easy when you are targeting reliable pages.
~~~
Alternatively, you can enter a script as follows:
var scriptNode = document.createElement ("script"); scriptNode.textContent = localMain.toString() + "\n localMain ();"; document.body.appendChild (scriptNode);
This method works in all relevant browsers.
~~~
Libraries such as jQuery can be copied or entered in a similar way.