webRequest of background requests works in Chrome but not FF

109 views Asked by At

In Chrome I'm able to use webRequest to listen to requests from the background by specifying tabId: -1 in the filter, however this doesn't work in FF. Further, if I remove the tabId criterion and listen to all requests, it picks up requests made in the frontend but still not in the background. Below is what I'm trying:

browser.webRequest.onHeadersReceived.addListener(
  function(x){
    console.log('onHeadersReceived',x);
  },
  {
    urls: ["<all_urls>"],
  },
  ['responseHeaders']
);

Is this the expected behavior or is there a way to listen to requests from the background in FF?

1

There are 1 answers

0
akb On

This is due to a bug in FF. The fix is scheduled for version 52 due for March '17.

https://bugzilla.mozilla.org/show_bug.cgi?id=1273138