I’m trying to make webrequest
API work with manifest V3.
For quick validation, I create a simple extension, including only two files:
manifest.json
{
"manifest_version": 3,
"version": "0.0",
"name": "DemoWebext",
"permissions": ["webRequest"],
"host_permissions": ["<all_urls>"],
"background": {
"scripts": ["bg.js"]
},
"browser_specific_settings": {
"gecko": {
"id": "DemoWebext@x"
}
}
}
bg.js
browser.webRequest.onBeforeRequest.addListener(function (requestDetails) {
console.log(requestDetails)
}, {
urls: ["<all_urls>"],
})
console.log('Hello')
Load this simple extension via about:debugging
(Firefox 116.0.2) and its console prints no more log but “Hello”. However, if I rewrite manifest.json
into manifest V2, this extension works well.
What’s the problem with this simple extension? Is it supported to use webrequest API with manifest V3? (At least, these methods seem callable…)