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 is 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?
Thank you, but this seems too complicated to me, can you send me part of code which just detects each URL (including hash) change, and logs it to console?
If you are only interested in hash changes, then use the hashchange event. However, the relevant window is in the content process (in multiprocess Firefox) so that might not be convenient. Using the progress listeners is something that can be done from the chrome process.