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
browser_style deprecated in MV3 #26642
Conversation
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.
Are you able to create a sample in mdn/webextensions-examples that shows how to migrate from MV2 + browser_style to MV3? Or should I provide these and let you link it from here?
@@ -87,7 +88,7 @@ The `action` key is an object that may have any of these properties, all optiona | |||
consistent with the browser's UI and with other extensions that use | |||
the <code>browser_style</code> property. Although this key defaults to | |||
<code>false</code>, it's recommended that you include it and set it to |
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.
It's not recommended to include it since support will be dropped. Reword this in every article. To avoid repetition consider relying on the canonical browser_styles article.
> **Note:** **Google Chrome** and **Opera** use `chrome_style` instead of `browser_style`, so if you wish to support them, you need to add both keys. | ||
> **Warning:** When `browser_style: true` is included in your web extension's manifest, text selection in your extension's UI is disabled except in input controls. If this causes a problem, include `browser_style:false` instead. | ||
|
||
> **Note:** **Google Chrome** and **Opera** use `chrome_style` instead of `browser_style`, so you need to add both keys to support them. |
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.
chrome_style support was removed from MV3.
When considering using `browser_style: true`, you need to test your extension with various themes (built-in or from AMO) to make sure that the extension UI behaves the way you expect it to. | ||
> **Note:** | ||
> Support for `browser_style` in Manifest V3 has been deprecated and, from Firefox 115, `options_ui.browser_style` and `sidebar_action.browser_style` default to `false`. `page_action.browser_style`, `browser_action.browser_style`, and `action.browser_style` already defaults to `false`. | ||
> If your Manifest V3 extension depends on the `browser_style: true` styles, bundle this stylesheet in the extension: [extension.css](https://hg.mozilla.org/mozilla-central/raw-file/a445f1762c895000bcdabd9d95697522359d41ed/browser/components/extensions/extension.css). |
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.
Repeat this recommendation and reference to the stylesheet in the Firefox panel components section at the bottom of this article.
Could you introduce a new section, Migrating away from browser_style? for example for options_ui (most common case since browser_style there used to default to true):
- set options_ui/browser_style to false. If nothing happened, just remove the key.
- if the appearance of the page changes, try to see what dependency there is, and put the relevant properties in the extension's stylesheet. In the bug I explained in detail which styles are most likely going to potentially cause (or not cause) issues.
- if one cannot figure out step 2, try including the content of extension.css with the extension and delete all parts that aren't relevant. Most extensions won't use browser-style class, so it's mainly the two blocks I annotated in the bug.
I'd be happy to do this. However, I suspect I might need quite a bit of your time to devise and fine-tune the example. Also, do we have a plan for how to include MV2 and MV3 examples? |
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.
I commented in action specifically because it is even more special; please update the page_action
, options_ui
, sidebar_action
to remove the repetition of what browser_style
does, and refer to the /en-US/docs/Mozilla/Add-ons/WebExtensions/user_interface/Browser_styles
page instead. And emphasize that browser_style support will be dropped.
The default changing from true to false is merely a transition tool, it is very much the intention to turn off support.
files/en-us/mozilla/add-ons/webextensions/user_interface/browser_styles/index.md
Outdated
Show resolved
Hide resolved
files/en-us/mozilla/add-ons/webextensions/user_interface/browser_styles/index.md
Outdated
Show resolved
Hide resolved
files/en-us/mozilla/add-ons/webextensions/user_interface/browser_styles/index.md
Outdated
Show resolved
Hide resolved
files/en-us/mozilla/add-ons/webextensions/user_interface/browser_styles/index.md
Outdated
Show resolved
Hide resolved
files/en-us/mozilla/add-ons/webextensions/manifest.json/action/index.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Rob Wu <rob@robwu.nl>
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.
Line 29: remove browser_style
from the example.
This also applies to the browser_action and page_action articles.
</p> | ||
<div class="notecard warning"> | ||
<p> | ||
Do not set `browser_style` to true: it is deprecated in Manifest V3, and support will be removed in Firefox 118. See <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/user_interface/Browser_styles#manifest_v3_migration">Manifest V3 migration for `browser_style`</a>. |
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.
The backticks are somehow not rendering here. Let's use <code>
tags instead.
This also applies to the other sections with the same issues (see the previews at #26642 (comment) )
<p> | ||
Do not set `browser_style` to true: it is deprecated in Manifest V3, and support will be removed in Firefox 118. See <a href="/en-US/docs/Mozilla/Add-ons/WebExtensions/user_interface/Browser_styles#manifest_v3_migration">Manifest V3 migration for `browser_style`</a>. | ||
</p> | ||
</div> | ||
<p> |
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.
Remove everything else in this cell (besides the depreciation notice above), until the closing </div>
. The information is not relevant and should not occupy that much space.
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.
Line 29: remove browser_style from example.
browser_style | ||
</a> | ||
</code> | ||
<br />{{optional_inline}} |
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.
All other keys are also optional. For consistency, add this label to the other action
keys.
browser_style | ||
</a> | ||
</code> | ||
<br />{{optional_inline}} |
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.
All other keys are optional, add the optional label to browser_action
keys for consistency.
browser_style | ||
</a> | ||
</code> | ||
<br />{{optional_inline}} |
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.
For consistency, add optional to every other key except for default_panel
.
|
||
When considering using `browser_style: true`, you need to test your extension with various themes (built-in or from AMO) to make sure that the extension UI behaves the way you expect it to. | ||
> **Note:** | ||
> Support for `browser_style` in Manifest V3 is deprecated. Starting from Firefox 115, the default value of `options_ui.browser_style` and `sidebar_action.browser_style` changes from `true` to `false`. In Firefox 118, `"browser_style": notrue` will no longer be supported in Manifest V3 extensions. |
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.
> Support for `browser_style` in Manifest V3 is deprecated. Starting from Firefox 115, the default value of `options_ui.browser_style` and `sidebar_action.browser_style` changes from `true` to `false`. In Firefox 118, `"browser_style": notrue` will no longer be supported in Manifest V3 extensions. | |
> Support for `browser_style` in Manifest V3 is deprecated. Starting from Firefox 115, the default value of `options_ui.browser_style` and `sidebar_action.browser_style` changes from `true` to `false`. In Firefox 118, `"browser_style": true` will no longer be supported in Manifest V3 extensions. |
@@ -91,7 +95,7 @@ The `options_ui` key is an object with the following contents: | |||
href="https://acorn.firefox.com/latest/acorn.html" |
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.
This recommendation does not make sense in the context of browser_style
. That page provides the resources (assets) to mimic the latest browser styles, but that is completely independent of the browser_style styles.
Let's keep the references to the "browser styles" article, and expand the article with a section that references acorn for people interested in that.
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.
This comment here also applies to sidebar_action and page_action, which has similar text.
…loor/content into Deprecate-browser_style-in-MV3
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.
r+, with the requested change to page_action and sidebar_action applied.
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.
While you've already mentioned the changed default, there is no mention of it in the release notes. Could you mention that the default of options_ui.browser_style
and sidebar_action.options_ui
changed from true to false for Manifest Version 3 extensions (and reference the browser_styles article with the deprecation guidelines)? If you'd like that can also be a follow-up PR. That release note should be associated with https://bugzilla.mozilla.org/show_bug.cgi?id=1830710
In any case, this is good to merge.
Co-authored-by: Rob Wu <rob@robwu.nl>
Description
Provides documentation for Bug 1827910 "Deprecate browser_style in MV3"