I am creating dynamic rules for declarativeNetRequest and passing the below data in updateDynamicRules
api, I saw that these rules are only getting applied on doc type of request (refer image) and not on other requests, whereas this should work on all requests and apis.
{
"addRules": [
{
"id": 67487208,
"priority": 1,
"action": {
"type": "modifyHeaders",
"requestHeaders": [
{
"header": "n",
"operation": "set",
"value": "true"
}
]
},
"condition": {
"urlFilter": "|https*",
"resourceTypes": [
"main_frame",
"sub_frame"
]
}
}
],
"removeRuleIds": [
67487208
]
}
this is the Manifest file
{
"name": "example",
"description": "example",
"version": "0.1",
"manifest_version": 3,
"action": {
"default_popup": "index.html"
},
"background": {
"service_worker": "background.js"
},
"host_permissions": ["<all_urls>"],
"permissions": ["storage", "declarativeNetRequest"]
}