On May 24, 3:02 pm, "LWChris@LyricWiki" <[email protected]> wrote:
> I could well imagine some iframe that retriggers the script because two
> "document-start" events are fired, maybe? Or does the page have two html
> or body tags?

Nope, no iframes, and no multiple body tags. I've done tests, and it's
definitely firing twice on the same page.
For now, my work-around is to set a variable on unsafeWindow, and if
it's defined, I exit the script immediately.
I still have no clue as to what is different in this page that causes
it to trigger twice, and apparently not in FF3.6, but it does in FF12.

Matt



On May 24, 3:02 pm, "LWChris@LyricWiki" <[email protected]> wrote:
> Am 24.05.2012 18:16, schrieb Matt Kruse:
>
> > After updating FF from 3.6 to the current 12, user scripts run at
> > document-start (in certain situations) are firing twice - once at
> > document-start as intended, then again at document-end.
>
> > Sample script:
> > // ==UserScript==
> > // @name        FB Test
> > // @namespace  http://userscripts.org/users/86416
> > // @include    https://www.facebook.com/
> > // @run-at         document-start
> > // ==/UserScript==
> > alert(document.getElementsByTagName('BODY').length);
>
> > When viewing the home news feed, this alerts "0" (expected), but then
> > also alerts "1" after the document loads.
> > But when I log off and load the login page, it only alerts "0"!
>
> > Any idea if this is a Greasemonkey bug or a FF bug? Or a quick in
> > Facebook? I can't duplicate the same functionality on CNN.com, for
> > example.
>
> > Is Facebook doing something that causes GM to fire again?
>
> > I've not yet tested other browser versions, will do that as well.
>
> > Thanks!
>
> > Matt Kruse
>

-- 
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