Noit wrote:
>Oh actually the main main problem i'm having is that location change fires even on tab change.
>
If you want to track each browser separately then use an all tabs
progress listener which will give you all of the location change events,
not just those for the current tab. (If you want to track the sidebar
too then there is a way of adding your progress listener to the window,
and if you want to catch absolutely everything then you can even add a
global progress listener.)
If you want to track the browser that's currently open, even when the
user has switched away, add your progress listener to that browser
instead of the tabbrowser.
If you want always want to track the browser in the current tab, then
you need to filter out tab switches; aRequest is null for a tab switch.
(I think it might have been null for some obscure error pages but I'm
not 100% sure.) Note that SeaMonkey sets the
LOCATION_CHANGE_SAME_DOCUMENT flag for a tab switch to stop its
doorhangers from dismissing; Firefox has different doorhanger code so it
doesn't do this.