Bill Donnelly <donnelly <at> snowcrest.net> writes:

> 
> Quote: "Greasemonkey only runs scripts when the page has loaded anyway"
> 
> This isn't really, completely true. Or not true at all. (afaik)
> 
> I think the person wants an "after onload" execution, which truly executes
> after the page has completely loaded.
> 
> Check out one of my extensions here:
> 
> http://www.snowcrest.net/donnelly/firefox/gmscripts/colorfix.user.js
> 
> Specifically, the "unsafeWindow.addEventListener ("load", ...." part.
> Although I'm not sure if using "unsafeWindow.addEventListener" is the
> correct or best way to do it now.
> 
> And you can get to the page's functions and variables. I would do it using
> the "unsafeWindow." thing, but there may be a better way to do it without
> using "unsafeWindow", whose use is discouraged as much as possible for
> security reasons.
> 
> Did I get close or closer?
> 


Very Close.
This is exactly what I want to do. But I cannot get the following code working!
Please help

function tester(){      
        window.location.href="http://www.google.com";;
        unsafeWindow.addEventListener ("load", function () { tester2() }, 
false);       
}

The function tester2 never gets called

-- 
You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/greasemonkey-users?hl=en.

Reply via email to