'Is redirect type not supported by Safari Browser in declarativeNetRequest rules?

I am trying to write a URL-redirection safari web extension.

manifest.json

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

rules.json

[
    {
        "id": 1,
        "priority": 1,
        "action": {
            "type": "redirect",
            "redirect": {
                "regexSubstitution": "https://example.com/"
            }
        },
        "condition": {
            "regexFilter": "http://*/",
            "resourceTypes": [
                "main_frame"
            ]
        }
    }
]

Expectation - any search should redirect to example.com

Getting this error Non-fatal issue: Rule with id 1 is invalid. redirect is not a supported action type.

The same code works fine in chrome as a chrome extension, giving error in safari browser only.

Is redirect not supported by safari? If no, what other options do i have to achieve it?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source