modifyHeaders Safari Extension

I want to execute the modifyHeaders method using a Safari extension. However, it doesn't work when I execute it in Safari. It works in Chrome. Why is that? I used this document as reference:

Part of manifest.json

"declarative_net_request": {
        "rule_resources": [{
            "id": "ruleset",
            "enabled": true,
            "path": "rules.json"
        }]
    },

    "host_permissions": [ "<all_urls>" ],
    "permissions": [
        "declarativeNetRequestWithHostAccess"
    ]

rules.json

[
    {
      "id": 1,
      "priority": 1,
      "action": {
        "type": "modifyHeaders",
        "responseHeaders": [
          {
            "header": "Content-Disposition",
            "operation": "remove"
          }
        ]
      },
      "condition": {
        "regexFilter": ".*",
        "resourceTypes": [
          "main_frame",
          "sub_frame"
        ]
      }
    }
]

[https://developer.apple.com/documentation/safariservices/safari_web_extensions/blocking_content_with_your_safari_web_extension]

For this to work in Safari, you have to grant the extension permission to access the page that you are trying to change the headers on. Have you tried that?

If you have, and it still doesn't work, can you include a sample project in some feedback on https://feedbackassistant.apple.com?

Thanks!

modifyHeaders Safari Extension
 
 
Q