Answer the question
In order to leave comments, you need to log in
How to pass Basic Auth via declarativeNetRequest?
Purely hypothetically, nothing prevents me from creating a rule where a header is added for all outgoing requests:
Proxy-Authorization: Basic {мой логин:пароль в base64 кодировке}
{
"name" : "Тест",
"manifest_version" : 3,
"version" : "1",
"description" : "Тестовое расширение",
"permissions" : [ "declarativeNetRequest" ],
"host_permissions": [ "*://*/*" ],
"declarative_net_request": {
"rule_resources": [{
"id": "ruleset_1",
"enabled": true,
"path": "rules.json"
}]
}
}
[
{
"id": 1,
"priority": 2,
"action": {
"type": "modifyHeaders",
"requestHeaders": [
{ "header": "Proxy-Authorization", "operation": "set", "value": "Basic ajHJjdkjHdsdkjsd" }
]
},
"condition": { "urlFilter": "*", "resourceTypes": [ "main_frame", "sub_frame", "stylesheet", "script", "image", "font", "object", "xmlhttprequest", "ping", "csp_report", "media", "websocket", "webtransport", "webbundle", "other" ] }
}
]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question