So it's probably something with that MSN ad JS. If I copy the source of the digg.com homepage into a local file, and load the file, I get the same error.
Normally handle_load would not get called since the GM script runs
after the load event has happened. Maybe the MSN script triggers a
second load event, and since the event is triggered by the website, it
is not allowed to access GM_* functions. Just guessing.
> On 15 Feb., 22:28, Anthony Lieuallen <arant...@gmail.com> wrote: > > On 2/15/2008 4:05 PM, Jesper Kristensen wrote: > > > Normally handle_load would not get called since the GM script runs > > > after the load event has happened.
> > Nope, sorry. GM scripts run at DOMContentLoaded which is always before > > plain "load" (which is after images, iframes, etc.).
An @include which matches the url having this code on it will not automatically match the url of the document in that iframe. Up until ifrm.contentDocument.write, the location of that iframe (ifrm.contentWindow.location.href) is "about:blank".
After that, it seems to pick up the url of the window that wrote to it, though. If a DOMContentLoaded event would fire after that write (which I would assume it does not), Greasemonkey should invoke whatever scripts are run for that url.
I would personally register a "load" event listener on that generated iframe, though, from a GM script that triggered on the page with the dynamics, rather than trying to figure out how to have a script be auto-invoked on a magically rendered web page using @include rules not really fit for that purpose.
> I would personally register a "load" event listener on that generated > iframe, though, from a GM script that triggered on the page with the > dynamics, rather than trying to figure out how to have a script be > auto-invoked on a magically rendered web page using @include rules not > really fit for that purpose.
The original user script author who reported this bug was targeting (and @includ-ing) digg. It was an MSN ad script which was included, doing crazy stuff with iframes, that triggered the bug. The author is not attempting to target this crazy frame, but the page it is being put into.
On Feb 17, 2008 5:39 PM, Anthony Lieuallen <arant...@gmail.com> wrote:
> On 2/17/2008 10:59 AM, Johan Sundström wrote: > > I would personally register a "load" event listener on that generated > > iframe, though, from a GM script that triggered on the page with the > > dynamics, rather than trying to figure out how to have a script be > > auto-invoked on a magically rendered web page using @include rules not > > really fit for that purpose.
> The original user script author who reported this bug was targeting (and > @includ-ing) digg. It was an MSN ad script which was included, doing > crazy stuff with iframes, that triggered the bug. The author is not > attempting to target this crazy frame, but the page it is being put into.