Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion @run-at document-start in FF12 fires script twice on Facebook.com?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Sam Larison  
View profile  
 More options May 25 2012, 3:19 am
From: Sam Larison <samlari...@gmail.com>
Date: Fri, 25 May 2012 03:19:57 -0400
Local: Fri, May 25 2012 3:19 am
Subject: Re: [greasemonkey-users] Re: @run-at document-start in FF12 fires script twice on Facebook.com?

Do you experience different results using the refresh button versus
pressing enter in the URL bar?

Unless there is facebook specific code, I would venture a guess that this
can be reproduced on another site...

An idea would be saving the facebook page as HTML and uploading it
somewhere, although my guess is that won't trigger the same behavior.

On Thu, May 24, 2012 at 11:28 PM, Matt Kruse <m...@thekrusefamily.com>wrote:

> On May 24, 3:02 pm, "LWChris@LyricWiki" <lwch...@gmx.de> 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" <lwch...@gmx.de> 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 greasemonkey-users@googlegroups.com.
> To unsubscribe from this group, send email to
> greasemonkey-users+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/greasemonkey-users?hl=en.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.