0

Is there any event I can subscribe to, and how, to be able to monitor URL change (including hash change)? Currently I do this with an setInterval() method, and check every second if URL has changed... But there must be some more efficient way I suppose?

I know in Javascript there is window.onhashchange event, but how do I get reference to window inside my AddOn code?

Also, I have tried using the

tabs.on('ready'....

and it reacts to URL change, but not to hash change :(

kecman
  • 813
  • 3
  • 14
  • 34
  • 1
    This appears to be a duplicate of: [Detect tab url change inside firefox add-on](http://stackoverflow.com/questions/30464941/detect-tab-url-change-inside-firefox-add-on). Please indicate if that does not solve your issue. – Makyen Mar 23 '16 at 05:10
  • In order to tell you how to get a reference to `window` in your add-on code we need to know which window, or windows you are attempting to get access to. Are you wanting to set up a listener for `hashcode` on every tab in every window? Do you want to do so only for a specific `tab` to which you already have a reference? We need more information. A [mcve] of what you are doing now would significantly help in understanding exactly what you are wanting to do. – Makyen Mar 23 '16 at 12:34

0 Answers0