[Greasemonkey] Run GM function from a bookmarklet

Aaron Boodman zboogs at gmail.com
Mon Aug 22 09:59:02 EDT 2005

unsafeWindow.dofoo = function() { ... }

from bookmarklet: dofoo();

downsides: content can define a setter or watch on the dofoo property
and prevent your code from running, or get the source of your user

Have you considered GM_registerMenuCommand? It is basically the same
thing as a bookmarklet. Then you wouldn't have this problem.


On 8/22/05, Bill Donnelly <donnelly at snowcrest.net> wrote:
>  Yes. I do that in my ColorFix script.
>  http://www.snowcrest.net/donnelly/gmscripts/#colors
>  The bookmarklet is:
>  javascript:/* Color UnFix */ checkColors (true); void(0)
>  -- 
> Sometimes bad things happen to good people.
> When that happens, those good people should
> seek out and find some bad people.
> And then do something bad to them.
> Just to even things out.
> It's only fair, after all.
> _______________________________________________
> Greasemonkey mailing list
> Greasemonkey at mozdev.org
> http://mozdev.org/mailman/listinfo/greasemonkey

More information about the Greasemonkey mailing list