Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistency: DNR Redirect Action using regexSubstitution #379

Closed
lukeselker opened this issue Apr 19, 2023 · 2 comments
Closed

Inconsistency: DNR Redirect Action using regexSubstitution #379

lukeselker opened this issue Apr 19, 2023 · 2 comments
Labels
implemented: safari Implemented in Safari inconsistency Inconsistent behavior across browsers topic: dnr Related to declarativeNetRequest

Comments

@lukeselker
Copy link

The DNR redirect action type allows for 4 optional properties: extensionPath, regexSubstitution, transform, and url.

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/declarativeNetRequest/Redirect

Sample Rule Configuration:

browser.declarativeNetRequest.updateDynamicRules({ addRules: [
  { 
    action: {redirect: {regexSubstitution: "[https://www.somesite.com/\\1](https://www.somesite.com///1)"}, type: "redirect"}, 
    condition: {regexFilter: ".*?://test/(.*?)", resourceTypes: ["main_frame"]}, 
    priority: 1, 
    id: 1,
  }
]})

When updating rules, there are no issues when specifying in Firefox/Chrome, but when specifying in Safari, the following error is thrown by the browser:

`redirect` is missing either a `url`, `extensionPath`, or `transform` key

It seems that this should be supported, and the issue has been reported here as well - https://bugs.webkit.org/show_bug.cgi?id=244475

@lukeselker
Copy link
Author

Hi,

It seems that this issue has been resolved as of the latest Safari Technology Preview. However, after getting past this I ran into another inconsistency with redirects. I've opened another issue here (#381)

@dotproto dotproto added inconsistency Inconsistent behavior across browsers topic: dnr Related to declarativeNetRequest follow-up: safari Needs a response from a Safari representative and removed needs-triage labels Apr 27, 2023
@zombie
Copy link
Collaborator

zombie commented Apr 27, 2023

Confirmed from the Safari team as resolved in current STP, closing.

@zombie zombie closed this as completed Apr 27, 2023
@Rob--W Rob--W added implemented: safari Implemented in Safari and removed follow-up: safari Needs a response from a Safari representative labels Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
implemented: safari Implemented in Safari inconsistency Inconsistent behavior across browsers topic: dnr Related to declarativeNetRequest
Projects
None yet
Development

No branches or pull requests

4 participants