Add cssOrigin to declarative contentScripts API (manifest.json, scripting, contentScripts)
Categories
(WebExtensions :: Compatibility, enhancement, P3)
Tracking
(firefox144 fixed)
| Tracking | Status | |
|---|---|---|
| firefox144 | --- | fixed |
People
(Reporter: erosman, Assigned: chrstina.lin, Mentored)
References
(Blocks 1 open bug)
Details
(Keywords: dev-doc-complete, good-first-bug, Whiteboard: [wecg][addons-jira])
Attachments
(1 file)
Similar to tabs.insertCSS(), an option to set cssOrigin would be beneficial. e.g.
browser.contentScripts.register({
matches: [hosts],
css: [{code, cssOrigin: "user"}],
runAt: "document_idle"
});
Comment 1•4 years ago
|
||
This sounds reasonable, and should be fairly easy since we already support it for tabs.executeScript. I'm expecting just a matter of adding a field to register options:
https://searchfox.org/mozilla-central/rev/1843375acb/toolkit/components/extensions/schemas/content_scripts.json#10
maybe forwarding it along the line in implementation starting from:
https://searchfox.org/mozilla-central/rev/1843375acb/toolkit/components/extensions/parent/ext-contentScripts.js#148
and adding a test probably around here:
https://searchfox.org/mozilla-central/rev/1843375acb/toolkit/components/extensions/test/xpcshell/test_ext_contentScripts_register.js
The guide to getting started is at https://wiki.mozilla.org/WebExtensions/Contribution_Onramp.
Updated•4 years ago
|
Hi,
since I'd like to practice testing in this scope, it's great if I can fix this bug. Could I?
Comment 3•4 years ago
|
||
Hello, I am new to contributing to Bugzilla can you assigned me to this issue so that I can learn to fix these bugs and also suggest to me how can Is start working on this bug to fix it
Comment 4•4 years ago
|
||
Sorry Falguni, but gero has asked first.
(In reply to gero from comment #2)
since I'd like to practice testing in this scope, it's great if I can fix this bug. Could I?
Sure, I assigned the bug to you. Take a look at comment 1 for details on getting started, and feel free to ask questions (use "request information" below the comment box here).
Comment 5•4 years ago
|
||
Hey Gero, how is it going with this bug? If you have an issue, feel free to ask.
Otherwise, we'd like to assign this bug to someone else.
Sry for being disappeared, feel free to assign it to the other guy.
Updated•4 years ago
|
Comment 7•4 years ago
|
||
HI there,
I would like to work on this issue, I have set development environment, can you please guide me solving this.
I set mozilla-central development environment, am I on right way for this issue?
Hi my name is Leslie and I am an Outreachy applicant. Can I work on this bug?
Comment 10•2 years ago
|
||
These days, the scripting API is the primary API to register content scripts and styles. Therefore I'm adjusting the title to reflect the full scope of changes.
There is consensus across browsers to support the feature, at https://github.com/w3c/webextensions/issues/414
Updated•1 year ago
|
Updated•1 year ago
|
Updated•5 months ago
|
Comment 11•5 months ago
|
||
(In reply to Rob Wu [:robwu] from comment #10)
These days, the
scriptingAPI is the primary API to register content scripts and styles. Therefore I'm adjusting the title to reflect the full scope of changes.
what do you mean by "full scope", are you proposing we should update the old contentScripts api as well?
Comment 12•5 months ago
|
||
(In reply to Tomislav Jovanovic :zombie from comment #11)
(In reply to Rob Wu [:robwu] from comment #10)
These days, the
scriptingAPI is the primary API to register content scripts and styles. Therefore I'm adjusting the title to reflect the full scope of changes.what do you mean by "full scope", are you proposing we should update the old
contentScriptsapi as well?
Initially this bug was about contentScripts only. I'm suggesting to expand it to scripting and the manifest key, because it does not make sense to add it to contentScripts.register only.
As the title shows, I'm suggesting to do it for all of the content script APIs, including contentScripts.
Last year I tried implementing a new content script field (match_origin_as_fallback in manifest - bug 1475831, and matchOriginAsFallback in the scripting API - bug 1853411), but initially not in contentScripts. That caused a regression in an extension (bug 1896669), so to minimize risk I also added the field to the existing contentScripts API.
| Assignee | ||
Comment 13•5 months ago
|
||
Updated•4 months ago
|
Comment 14•2 months ago
|
||
This good-first-bug hasn't had any activity for 2 months, it is automatically unassigned.
For more information, please visit BugBot documentation.
Updated•2 months ago
|
Updated•2 months ago
|
Updated•2 months ago
|
Comment 15•2 months ago
|
||
Comment 16•2 months ago
|
||
| bugherder | ||
Comment 17•2 months ago
|
||
Documentation updates available in:
Description
•