webRequest of background requests works in Chrome but not FF

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?

I don’t know the answer to your question, but I suggest you file a bug report here. It’s possible that case wasn’t contemplated or known.

Ah, I see it has already been reported. Targeted for release in 52.

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

Thanks!