WebExtension: content scripts should be injected in data URL pages
Categories
(WebExtensions :: General, defect, P2)
Tracking
(firefox-esr102 wontfix, firefox-esr115 wontfix, firefox108 wontfix, firefox109 wontfix, firefox110 wontfix, firefox126 wontfix, firefox127 wontfix, firefox128 fixed)
People
(Reporter: bugzilla, Assigned: robwu)
References
(Regression)
Details
(Keywords: dev-doc-complete, regression, Whiteboard: [addons-jira])
Attachments
(7 files)
46.89 KB,
image/png
|
Details | |
42.04 KB,
image/png
|
Details | |
1.04 KB,
application/zip
|
Details | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
Comment 1•7 years ago
|
||
Assignee | ||
Comment 7•7 years ago
|
||
Assignee | ||
Comment 8•7 years ago
|
||
str |
Updated•7 years ago
|
Reporter | ||
Comment 10•7 years ago
|
||
Reporter | ||
Comment 11•5 years ago
|
||
Any news here?
Assignee | ||
Comment 12•5 years ago
•
|
||
I may take a look at this bug when I strart working on a related issue with sandboxed documents (bug 1411641).
Reporter | ||
Comment 13•5 years ago
|
||
@Rob Wu: What issue about sandboxed documents did you want to link? You linked this bug and not the other one.
Assignee | ||
Comment 14•5 years ago
|
||
(In reply to kkapsner from comment #13)
@Rob Wu: What issue about sandboxed documents did you want to link? You linked this bug and not the other one.
I edited my comment. I meant to link to bug 1411641.
Assignee | ||
Comment 15•5 years ago
|
||
Chrome is going to support data:
-URLs with the match_data_urls
field, with similar semantics as match_about_blank
.
https://bugs.chromium.org/p/chromium/issues/detail?id=55084#c45
Assignee | ||
Comment 16•5 years ago
|
||
match_data_urls
is not going to be implemented after all; instead we have designed a new property with more sane semantics, called match_origin_as_fallback
. This allows extensions to run content scripts in data:, blob:, about:, solely based on the origin of the document (and in case of opaque origins, the "precursor" origin that created the document).
The discussion of the design of this new property starts at https://bugs.chromium.org/p/chromium/issues/detail?id=55084#c60 and is summarized in https://bugs.chromium.org/p/chromium/issues/detail?id=55084#c70 .
Assignee | ||
Updated•5 years ago
|
Reporter | ||
Comment 17•4 years ago
|
||
I hope this will also be available in browser.contentScripts.register.
Comment 18•4 years ago
|
||
Any updates?
Assignee | ||
Comment 19•4 years ago
|
||
This is on my list, but I need to finish other tasks before I can get to this.
Reporter | ||
Comment 20•3 years ago
|
||
Any updates?
Updated•3 years ago
|
Comment 21•3 years ago
|
||
The severity field for this bug is relatively low, S3. However, the bug has 13 votes.
:robwu, could you consider increasing the bug severity?
For more information, please visit auto_nag documentation.
Comment 22•3 years ago
|
||
The last needinfo from me was triggered in error by recent activity on the bug. I'm clearing the needinfo since this is a very old bug and I don't know if it's still relevant.
Updated•2 years ago
|
Comment 24•2 years ago
|
||
Set release status flags based on info from the regressing bug 1324406
Updated•2 years ago
|
Updated•2 years ago
|
Comment hidden (admin-reviewed) |
Comment hidden (admin-reviewed) |
Comment hidden (admin-reviewed) |
Updated•2 years ago
|
Reporter | ||
Comment 28•2 years ago
|
||
Any progress on this topic?
Assignee | ||
Comment 29•1 year ago
|
||
This is likely going to be resolved when bug 1411641 gets addressed, as part of the "matchOriginAsFallback" / match_origin_as_fallback
flag.
Updated•1 year ago
|
Assignee | ||
Comment 30•1 year ago
|
||
Add missing test cases for existing match_about_blank behavior:
- javascript:-URLs resolve to about:blank and code should inject there.
The following cases are not documented, but this patch adds test
coverage before we change the implementation:
-
blob:-URLs are currently matched because they inherit the principal.
-
data:-URLs. They are special because they have an opaque origin now,
but for a very long time they did not. Additionally, there is an
undocumented case where data:-URLs can execute.
Assignee | ||
Comment 31•1 year ago
|
||
URLInfo::InheritsPrincipal() is used to support the match_about_blank
feature. When that flag is used, a content script should execute in
about:blank and about:srcdoc.
When the logic was introduced in Firefox 55 (bug 1368102), data:-URLs
could inherit the principal like about:blank / about:srcdoc, thanks to
this URI_INHERITS_SECURITY_CONTEXT check in URLInfo::InheritsPrincipal.
In Firefox 57 (bug 1324406), data:-URLs got an opaque origin by default.
In Firefox 83 (bug 1552168), this became the only supported behavior
with the removal of the security.data_uri.unique_opaque_origin
pref.
Because the URI_INHERITS_SECURITY_CONTEXT check is not doing anything,
this patch removes it.
The patch does not add data: support to match_about_blank; the intent is
to add that later as part of match_origin_as_fallback.
Assignee | ||
Comment 32•1 year ago
|
||
Adds match_origin_as_fallback support to content_scripts declared
statically in manifest.json.
Support for this option in dynamic registration and execution will be
handled in the next patches.
Assignee | ||
Comment 33•1 year ago
|
||
Add support for dynamic insertion of content scripts and styles in
sandboxed documents / frame with an opaque origin, via the scripting API
(executeScript / insertCSS / removeCSS).
Previously, we used the matchAboutBlank flag internally, which matches
less than the matchOriginAsFallback option that was just introduced.
Specifically, sandboxed about:blank/about:srcdoc and data:-URLs were
not scriptable before, but now they are.
To encourage the use of the scripting API, the MV2-only versions in the
tabs API did not get this feature.
Comment 34•1 year ago
|
||
Comment 35•1 year ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/1eabe598552b
https://hg.mozilla.org/mozilla-central/rev/82a799bad541
https://hg.mozilla.org/mozilla-central/rev/8a60644a680e
https://hg.mozilla.org/mozilla-central/rev/aed79cb14fe2
Updated•1 year ago
|
Assignee | ||
Updated•1 year ago
|
Comment 36•1 year ago
|
||
Should we call this out in the Fx128 relnotes? Please nominate if yes.
Assignee | ||
Comment 37•1 year ago
|
||
No need for it to be part of the relnotes. It should be mentioned in the Firefox 128 for Developers article on MDN, which is covered by the dev-doc-needed keyword.
Comment 38•10 months ago
|
||
Change are ready for review:
Description
•