Yes, since document start fires onLocationChange - and the URL bar is updating to a new location (not simply using the #historycrumb method) - even though the dom is not destroyed - and even though the same document, body, and all the other elements are still there (behind the photo you click on) - facebook has used that new javascript API for directly modifying the URL bar and creating a history entry, which is fine, but unfortunately since this is how we currently detect document-start ( onLocationChange ) the script will fire again.
A similar method that you use in script to prevent things from running (or otherwise decide to run something) could be implemented within greasemonkey however that solution is still not ideal. If you match a certain page within facebook then you may not experience as many issues. see window.history.pushState http://stackoverflow.com/questions/824349/modify-the-url-without-reloading-the-page On Tue, May 29, 2012 at 2:57 PM, Matt Kruse <[email protected]> wrote: > On May 29, 1:07 am, Sam Larison <[email protected]> wrote: > > The only guess I can venture is that the loading of XMLHTTP data by > > facebook is somehow triggering a document created event. > > I thought of this also, but I can't identify anything of this sort. > I'll keep looking. > > > Does it run again when you click a photo someone posted? > > YES! When it pops up the photo viewer, I get a "1". And when I pres > ESC to close it, I get a "1" again. So clearly, the event that > Greasemonkey is hooking into is being called multiple times. I didn't > realize that there was any way to manually trigger this event. Do you > have any clue what might be going on? > > 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.
