Reputation: 21
⚠ in MV2 we using (webRequest
) for proxy authorization . and today some parts not working !
google chrome suggested that we use (declarativeNetRequest
) in MV3
Now my question is How to work with it ? ( for proxy authorization )
Google chrome still gives me sign in alert
My code is :
manifest.json
{
"name": "Test",
"version": "1.0.0",
"description": "Test",
"manifest_version": 3,
"declarative_net_request": {
"rule_resources": [
{
"id": "ruleset_1",
"enabled": true,
"path": "rules.json"
}
]
},
"permissions": [
"proxy",
"declarativeNetRequest",
"declarativeNetRequestWithHostAccess",
"declarativeNetRequestFeedback"
],
"host_permissions": [
"<all_urls>"
],
"background": {
"service_worker": "background.js",
"type": "module"
},
"action": {
"default_popup": "popup.html",
"default_icon": {
"128": "./icon/128.png",
"48": "./icon/48.png",
"32": "./icon/32.png",
"16": "./icon/16.png"
}
},
}
rules.json
[
{
"id": 1,
"priority": 1,
"action": {
"type": "modifyHeaders",
"responseHeaders": [
{
"header": "Proxy-Authenticate",
"operation": "set",
"value": "Basic freeuser1:freeuser1"
}
]
},
"condition": {
"resourceTypes": [
"main_frame"
]
}
}
]
Upvotes: 2
Views: 1135