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?