-
Notifications
You must be signed in to change notification settings - Fork 22.9k
Bug-1679997 CSS Origin to contentScripts APIs (update) #41025
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
base: main
Are you sure you want to change the base?
Bug-1679997 CSS Origin to contentScripts APIs (update) #41025
Conversation
Apologies @Rob--W as the other PR was approved, I didn't go looking for additional feedback before merging. |
Preview URLs
External URLs (1)URL:
(comment last updated: 2025-09-07 16:36:56) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
manifest.json/content_scripts
is also missing mention of case sensitivity.
The release notes also fail to mention that the APIs that take them are now case insensitive.
- : An array of objects. Each object has either a property named `file`, which is a URL starting at the extension's manifest.json and pointing to a CSS file to register, or a property named `code`, which is some CSS code to register. | ||
- `cssOrigin` {{optional_inline}} | ||
- : `string`. The origin of the CSS to inject. This affects the cascading order (priority) of the injected stylesheets. Takes the values `"author"` and `"user"`. Defaults to `"author"`. | ||
- : `string`. The style origin for the injection, either `"user"`, to add the CSS as a user stylesheet, or `"author"`, to add it as an author stylesheet. Defaults to ``"author"`. This property is case insensitive in Firefox and Safari. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Case insensitivity is only in Firefox 144 and later.
Safari does not support the contentScripts API. The scripting API is the cross-browser version of it.
- : `array` of `string`. The list of CSS files to be injected into matching pages. These are injected in the order they appear in this array. | ||
- `cssOrigin` {{optional_inline}} | ||
- : `string`. The origin of the CSS to inject. This affects the cascading order (priority) of the injected stylesheets. Takes the values `"author"` and `"user"`. Defaults to `"author"`. | ||
- : `string`. The style origin for the injection, either `"user"`, to add the CSS as a user stylesheet, or `"author"`, to add it as an author stylesheet. Defaults to ``"author"`. This property is case insensitive in Firefox and Safari. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Case insensitive in Firefox 144 and later.
@Rob--W this should fix the issues, sorry about that. |
</ul> | ||
<li><code>"user"</code>, to add as a user stylesheet.</li> | ||
<li><code>"author"</code>, to add as an author stylesheet.</li> | ||
</ul> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[mdn-linter] reported by reviewdog 🐶
</ul> | |
</ul> |
Co-authored-by: Rob Wu <[email protected]>
Description
Addresses feedback provided by @Rob--W in #40955 (review)