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?
I read Dive into Greasemonkey (by Mark Pilgrim ) written in 2005. It mentions
Share
GM listens to DOMContentLoaded event (basically DOM Ready) here. Then wraps the userscript code and inserts that into a sandbox, here.