Docs: webRequestBlocking in Manifest V3 ?
I assume this documentation is for Manifest v3. It does mention webRequestBlocking which when added to the manifest file results in 'webRequestBlocking' requires manifest version of 2 or lower.

manifest.json
{
"name": "",
"manifest_version": 3,
...
"permissions": [
...
"webRequest",
"webRequestBlocking"
]
...
}
Version 1.28.105 Chromium: 92.0.4515.131 (Official Build) (x86_64)
@awfuchs did you have a chance to look at it? Would be much appreciated!
@tf42src
The new declarativeNetRequestWithHostAccess permission allows extensions to use the chrome.declarativeNetRequest API on sites the extension has host permissions for. This also enables existing Manifest V2 extensions that use webRequest, webRequestBlocking, and site-specific host permission to migrate to the chrome.declarativeNetRequest API without requiring the user to approve new permissions.
via official docs: https://developer.chrome.com/docs/extensions/whatsnew/
Does this help?
CC: @dotproto, as I believe @awfuchs is no longer working on Chrome Extensions.
I try to use declarativeNetRequest to instead of webRequestBlocking.
In manifest.json
"manifest_version": 3,
"permissions": [
"declarativeNetRequest",
]
In background.js or devtool.js
chrome.declarativeNetRequest.updateDynamicRules({
addRules: [{
'id': 1001,
'priority': 1,
'action': {
'type': 'block'
},
'condition': {
'urlFilter': 'twitter.com',
'resourceTypes': [
'csp_report', 'font', 'image', 'main_frame', 'media', 'object', 'other', 'ping', 'script',
'stylesheet', 'sub_frame', 'webbundle', 'websocket', 'webtransport', 'xmlhttprequest'
]
}
}],
removeRuleIds: [1001]
})
I assume this documentation is for Manifest v3.
yeah that page doesn't mention anything about the changes in manifest v3. it needs a big red warning like the one here.
webRequest blocking for MV3 policy installed extensions is being tracked in crbug.com/1024211.
@solomonkinard I think you meant to link to a different issue.
Fixed in new Migration guide and PR's https://github.com/GoogleChrome/developer.chrome.com/pull/5473 and https://github.com/GoogleChrome/developer.chrome.com/pull/4603