0

I'm developing my first add-on with Add-on SDK, jpm (because I need to support old versions of Firefox)

I need to track URL changes in address bar, I found that such thing can be done with using of a nsIWebProgressListener interface.

I found this solution: Detect tab URL change inside a Firefox add-on, but it does not work on multiprocess Firefox (Electrolysis), because it uses incompatible tabs/utils API.

Fragment of code:

tabs.on('open', function(newTab) {
    var lowLevel = viewFor(newTab);
    var browser = getBrowserForTab(lowLevel);
    browser.addProgressListener(progressListener);
});

Function getBrowserForTab is not compatible with e10s, and does not work properly.

What can I do?

Community
  • 1
  • 1
Kesantielu Dasefern
  • 266
  • 1
  • 3
  • 12
  • The [answer to the question to which you link that explicitly states it is for the Add-on SDK](http://stackoverflow.com/a/30489715/3773011) uses [sdk/tabs](https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/tabs) which is fully compatible with e10s. Is there some reason that answer does not solve your problem? – Makyen Oct 23 '16 at 23:51
  • @Makyen tabs.on('ready' ... ) doesn't fire when getting new content via ajax – Kesantielu Dasefern Oct 24 '16 at 05:25
  • Then please be *explicit* as to what you want to be notified about. Being notified about generically getting content via AJAX is not mentioned in your question. Are you wanting to be notified on all AJAX requests? Your question says notification *only* when the URL in the address bar changes (or would have changes if the tab was active)? With which portions (methods) of `tabs/utils` are you having a problem when e10s enabled? Are you making the statement that it is incompatible based on actual testing? What version of Firefox are you testing with? Please add your code to the question. – Makyen Oct 24 '16 at 06:03
  • I want **detect URL changes in address bar**, no matter how it happens, ajax, non-ajax. All about URL changes in the address bar. Problem with `getBrowserForTab` function, not compatible with e10s. – Kesantielu Dasefern Oct 24 '16 at 06:38

0 Answers0