0

Declarative net Request modify header rule is not working for safari. Works fine on all other browsers (chrome, edge , FF etc)

Safari Version 16.5.2 (18615.2.9.11.10)

manifest rule: "declarativeNetRequestWithHostAccess"

Error: [Error] Error: Invalid call to declarativeNetRequest.updateDynamicRules(). Error with rule at index 0: Rule with id 100 is invalid. The header x-source is not recognized.

However, if I change the header name to "Origin" it works. Is there a restriction on which all header names are supported?

await browser.declarativeNetRequest.updateDynamicRules({ addRules: x });

var x = [{ "id": 100, "priority": 1, "action": { "type": "modifyHeaders", "requestHeaders": [ { "header": "x-source", "operation": "set", "value": "test" } ] }, "condition": { "urlFilter": "https://*/*" } }]

surya
  • 991
  • 1
  • 12
  • 22
  • Adding details about Safari version would help since Safari 16.4 release added a lot of new APIs for 'declarativeNetRequest'. – Ahmad Saleem Jul 15 '23 at 19:40

0 Answers0