I'm trying to load a page in a tab and get the status code returned.
I'm updating the tab using
chrome.tabs.update({
url: url
})
I have the following listener set up, but for some reason it's never being called.
chrome.webRequest.onCompleted.addListener(function processLoadPage(details) {
console.log(`Got http status code ${details.statusCode}`);
}, { urls: ["<all_urls>"] });
I tried using chrome.tabs.onUpdated.addListener which does get called and has a status but I don't see anyway to get the actual http status code from this.
I'm using manifest v3 and this is running in a service worker. I have the following permissions
"permissions": [
"storage",
"downloads",
"tabs",
"activeTab",
"scripting",
"webRequest",
"webRequestBlocking",
"<all_urls>"
],