[Greasemonkey] Long literal strings of html

Edward Lee edilee at gmail.com
Wed Apr 20 20:09:48 EDT 2005


On 4/20/05, Julien Couvreur <julien.couvreur at gmail.com> wrote:
> since you can have it as a string object directly...
>            win.GM_getSelf = function() {
>              return getContents(getScriptChrome(script.filename));
>            }
>            runBrowserScript(...
>               "var GM_getSelf = window.GM_getSelf;"

Nice ;) Much cleaner :) But no fun with anonymous functions + closures!

How about a win.GM_getSelf = (function(contents) { return function() {
return contents; }; })
(getContents(getScriptChrome(script.filename))); :D


-- 
Ed


More information about the Greasemonkey mailing list