On May 30, 10:45 am, Sam Larison <[email protected]> wrote:
> aProgress.isLoadingDocument is probably what is tripping it up
> https://developer.mozilla.org/en/nsIWebProgress
> This is the start point for the listener documentation
> https://developer.mozilla.org/En/XUL/Method/AddTabsProgressListener
> Monitoring onStateChange ourselves will possibly provide some clues or a
> workaround
> Within facebook we might try something, I found the code for the history
> manager, could try over-riding it and see if the problem goes away
> __d("HistoryManager", ["event-extensions", "function-extensions", "Cookie",
> "Env", "URI", "UserAgent", "copyProperties", "goOrReplace"], function (a,
> b, c, d, e, f) {return;});

I got it! After debugging for quite some time (Facebook code is
ridiculously, unnecessarily complex), I found the culprit.

Their code is calling window.history.replaceState BEFORE the window is
loaded, which is triggering GM to fire again.
I've created the simplest test case I can that also fails:
http://socialfixer.com/temp/replacestate.html

In this test, I call replaceState() on DOMContentLoaded, and it in
turns fires the script again. The example "detection" script I am
using can be found on this page also.

I also noticed that FB is calling replaceState with only two
arguments, and no url. I'm not sure if this is part of the problem
too?

Hope this helps. Do you need any further investigation from me? I know
very little about how GM integrates into Firefox, so how you hook into
their events is beyond me :)

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