-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Calling patternToRegex
on <all_urls>
should match about:srcdoc
#13
Comments
It's a bit complicated because https://stackoverflow.com/a/31052496
So there's a varying degree of support for these protocols, depending on where they're used. I might add support for it via option, but for the issue at hand, you can probably inline a specific check on this line for now until I figure out what to do: |
More context in the source: https://chromium.googlesource.com/chromium/src/+/refs/heads/main/extensions/common/url_pattern.cc#31 No mentions of srcdoc found :( |
I agree that it would need to be behind and option/in a different method.
👍 |
As specified in pixiebrix/pixiebrix-extension#8170, From this API's standpoint:
|
However:
Ideally you should follow the browser and never match if (location.href === 'about:srcdoc') {
return pattern.matches(window.parent.location.href); // Parent URL
} else {
return pattern.matches(location.href);
} You can take shortcuts to this depending on what you want to do next. Since function shouldBrickRunHere(pattern) {
// 100% certainty probably 🤞 probably 🤞
return pattern.matches(location.href) || pattern === `<all_urls>` || pattern === `*://*/*`;
} |
From an extension architecture standpoint, I believe iframes should be dependents/puppets of the main frame and should not run anything independently, but this is much harder to achieve. |
patternToRegex
on <all_urls>
should match srcdoc:
patternToRegex
on <all_urls>
should match about:srcdoc
Report
<all_urls>
matchessrcdoc:
iframes<all_urls>
as the pattern: https://developer.chrome.com/docs/extensions/reference/api/contextMenus#method-createRelated
<all_urls>
#3The text was updated successfully, but these errors were encountered: