Open lukeselker opened 1 year ago
For this use-case you have to use extensionPath
instead of url
in Safari, i.e:
action: {
type: "redirect",
redirect: {
extensionPath: "/image.png",
}
}
Here's a full example: https://github.com/duckduckgo/mv3-compat-tests/blob/main/Shared%20(Extension)/Resources/tests/test.declarativeNetRequest.js#L274-L278
Thanks @sammacbeth, but this doesn't allow us to do regexSubstitution when using a redirect to an extension page.
@xeenon let me know if you need me to open a bug in https://bugs.webkit.org/ for this 👍
@lukeselker Feel free, thanks!
Looks like someone just opened a bug today for this exact issue -> https://bugs.webkit.org/show_bug.cgi?id=256054
A possible solution is to allow regex substitutions \0 \1 etc. inside extensionPath
when regexFilter is present. There'll be an additional benefit in case #604 is solved: no need to expose the target in web_accessible_resources.
Hi all!
When using Declarative Net Request to handle extension redirects, I'm having an inconsistency between browsers when using a callback url to open the extension. In chrome, this redirect to a
chrome-extension://<extension-id>
url functions properly, but in safari, the redirect to asafari-web-extension://<extension-id>
url is being blocked with the following error:Is there a way for this to be handled consistently across browsers? I understand the reasoning behind only allowing https/http redirects, but it seems that safari-web-extension scheme should also be an allowed scheme for redirects.