I read "Dive into Greasemonkey" (by Mark Pilgrim) written in 2005. It mentions that Greasemonkey wraps a user script in an anonymous function wrapper. Does Greasemonkey insert the wrapper into the source JavaScript code or add it as any event handler such as window.onload
?
To access Greasemonkey's management pane, click on the downward arrow on the right side of the button Greasemonkey to the right of your URL bar and select Manage User Scripts. This opens a tab with a list of your scripts.
Tampermonkey is used to run so-called userscripts (sometimes also called Greasemonkey scripts) on websites. Userscripts are small computer programs that change the layout of a page, add or remove new functionality and content, or automate actions.
Tampermonkey is a donationware userscript manager that is available as a browser extension. This software enables the user to add and use userscripts, which are JavaScript programs that can be used to modify web pages.
They're stored in an IndexedDB ( https://github.com/greasemonkey/greasemonkey/blob/master/src/bg/user-script-registry.js#L287 ) which is a format with very little (AFAIK?) tooling. (Because there's very few options for persistence for a WebExtension.)
Does Greasemonkey insert the wrapper into the source JavaScript code or add it as any event handler such as window.onload?
GM listens to DOMContentLoaded event (basically DOM Ready) here. Then wraps the userscript code and inserts that into a sandbox, here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With