NEW290922
declarativeNetRequest modifyHeaders doesn't support custom headers
https://bugs.webkit.org/show_bug.cgi?id=290922
Summary declarativeNetRequest modifyHeaders doesn't support custom headers
Jeff Johnson
Reported 2025-04-02 07:46:14 PDT
Created attachment 474805 [details] Example extension background.js Unlike Chrome and Firefox, Safari doesn't support custom headers with declarativeNetRequest modifyHeaders. Attached is a sample web extension demonstrating the issue. The extension gives the following error: "Invalid call to declarativeNetRequest.updateDynamicRules(). The 'addRules' value is invalid, because an error with rule at index 0: Rule with id 1 is invalid. The header `Foo` is not recognized." Another, tangential issue is that updateDynamicRules throws an exception, caught in my try-catch block, rather than rejecting the promise that's supposed to be returned by updateDynamicRules.
Attachments
Example extension background.js (1.92 KB, application/x-javascript)
2025-04-02 07:46 PDT, Jeff Johnson
no flags
Sample extension manifest.json (398 bytes, application/json)
2025-04-02 07:46 PDT, Jeff Johnson
no flags
1-star App Store review of Safari extension (40.76 KB, image/png)
2026-03-19 04:21 PDT, Jeff Johnson
no flags
Jeff Johnson
Comment 1 2025-04-02 07:46:32 PDT
Created attachment 474806 [details] Sample extension manifest.json
Radar WebKit Bug Importer
Comment 2 2025-04-02 07:46:55 PDT
Timothy Hatcher
Comment 3 2025-06-13 12:02:51 PDT
*** Bug 293576 has been marked as a duplicate of this bug. ***
Pas
Comment 4 2025-10-30 10:26:20 PDT
bump. I hope this can get fixed soon
Jeff Johnson
Comment 5 2026-03-19 04:21:32 PDT
Created attachment 478722 [details] 1-star App Store review of Safari extension Attached is a screenshot of a 1-star App Store user review that my Safari extension received due to this bug.
Note You need to log in before you can comment on or make changes to this bug.