Does safari support modification of request headers by using declarativeNetRequest?
I want to change the sec-fetch-dest, sec-fetch-mode value in request header using declarativeNetRequest.
So I just set the manifest value as follows.
{
"manifest_version": 3,
...
"name": "modifyHeader test",
"description": "sample extension",
"version": "1.0",
...
"permissions": [
"declarativeNetRequest",
"declarativeNetRequestWithHostAccess",
"activeTab"
],
"declarative_net_request": {
"rule_resources": [
{
"id": "ruleset_for_test",
"enabled": true,
"path": "test_rules.json"
}
]
},
"host_permissions": [
"<all_urls>"
],
....
"content_scripts": [{
"js": [ "content.js" ],
"matches": [ "*://www.acmicpc.net/*" ]
}],
....
}
And test_rules.json
is as follows
{
"id": 1,
"priority": 1,
"action": { "type": "modifyHeaders",
"requestHeaders": [
{ "header": "sec-fetch-dest", "operation": "set", "value": "document" },
{ "header": "sec-fetch-mode", "operation": "set", "value": "navigate" }
]
},
"condition": { "domains":["acmicpc.net"], "resourceTypes": ["xmlhttprequest"] }
}
However, safari does not change the request header.
So I just wonder does safari allow modification of headers through declarativeNetRequest.