Open Bug 1679997 Opened 3 years ago Updated 5 months ago

Add cssOrigin to declarative contentScripts API (manifest.json, scripting, contentScripts)

Categories

(WebExtensions :: General, enhancement, P3)

enhancement

Tracking

(Not tracked)

People

(Reporter: eros_uk, Unassigned, Mentored)

References

(Blocks 1 open bug)

Details

(Keywords: good-first-bug, Whiteboard: [wecg])

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"
});

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.

Mentor: tomica
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: good-first-bug
Priority: -- → P3
Severity: -- → N/A

Hi,

since I'd like to practice testing in this scope, it's great if I can fix this bug. Could I?

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

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).

Assignee: nobody → gero

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.

Flags: needinfo?(gero)

Sry for being disappeared, feel free to assign it to the other guy.

Flags: needinfo?(gero)
Assignee: gero → nobody

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?

Flags: needinfo?(tomica)

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

Blocks: 1687764
Flags: needinfo?(tomica)
Summary: Add cssOrigin to contentScripts API → Add cssOrigin to declarative contentScripts API (manifest.json, scripting, contentScripts)
Whiteboard: [wecg]
See Also: → 1428398
You need to log in before you can comment on or make changes to this bug.