Thanks everyone for your work figuring this out so far. It really should be reported as an issue which is tracked until it's fixed:
https://github.com/greasemonkey/greasemonkey/issues Ideally, with a reproducible testcase which is standalone (not Facebook). I'm a bit busy at the moment to do this myself, but if an issue is reported, I'll get to it when I have time. On Tue, May 29, 2012 at 3:11 PM, Matt Kruse <[email protected]> wrote: > On May 29, 2:03 pm, Sam Larison <[email protected]> wrote: > > see window.history.pushState > > Ah, I didn't realize that using pushState/replaceState would actually > trigger Greasemonkey to fire again. IMO, it really shouldn't, because > the DOM is not being re-loaded. Just because the url changes doesn't > necessarily mean that the page is changing, and you could run the risk > of a GM script being run twice or more on the same DOM. > > I'm also finding that the script does not fire consistently. Even > though the url changes (I assume via pushState), the script is > sometimes not fired again. So it's not really dependable. > > For now, I will stick with setting a flag on unsafeWindow, and exiting > my script if the flag is already set. That will guarantee that I run > only once. If there is a preferred work-around, let me know. > > Thanks for the clarification! > > 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. > > -- 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.
