[Webkit-unassigned] [Bug 253696] New: declarativeNetRequest modifyHeaders doesn't work for fetch requests initiated from the same Safari extension

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Mar 10 02:07:29 PST 2023


https://bugs.webkit.org/show_bug.cgi?id=253696

            Bug ID: 253696
           Summary: declarativeNetRequest modifyHeaders doesn't work for
                    fetch requests initiated from the same Safari
                    extension
           Product: WebKit
           Version: Safari Technology Preview
          Hardware: All
                OS: All
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKit Extensions
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: vsr4493 at gmail.com
                CC: timothy at apple.com

ModifyHeaders in declarativeNetRequest  does not work for fetch requests from the extension.
This might be since the extension does not have permission over the safari-extension://GUID/ origin which is reset on every browser launch.

Expected behaviour:
The extension should have permissions for its own origin by default and should be able to modify headers for requests initiated from its own background page.

As such adding a rule like this should work:

browser.declarativeNetRequest.updateDynamicRules({
   addRules: [{
      "id": 1, 
      "priority": 1, 
      "action": {
         "type": "modifyHeaders", 
         "requestHeaders": [{"header": "origin", "operation": "set", "value": "https://www.bar.com"}]
      }, 
      "condition": {
         "urlFilter": "http://foo.com", // Any URL that the extension has permissions for
         "resourceTypes": ["main_frame", "xmlhttprequest"]
      }
   }],
})


Current behaviour:
The rule currently does not work

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230310/1bb893ab/attachment.htm>


More information about the webkit-unassigned mailing list