为提升您的使用体验,本站正在维护,部分功能暂时无法使用。如果本站文章无法解决您的问题,您想要向社区提问的话,请到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 提问,我们的支持社区将会很快回复您的疑问。

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

Firefox userChrome meta tag

  • 8 个回答
  • 0 人有此问题
  • 3 次查看
  • 最后回复者为 cor-el

more options

Is it possible to edit the userChrome.css file to have the tab/tool bar change colors like in Safari 15? I am new to CSS but would love to know if this is possible.

Is it possible to edit the userChrome.css file to have the tab/tool bar change colors like in Safari 15? I am new to CSS but would love to know if this is possible.

所有回复 (8)

more options

It is possible to change the colors of the table bar and tool bar in Firefox. To do this, first go to the settings (three horizontal lines in the upper right corner), then press Add-ons and Themes (Ctrl+Shift+A), then Firefox sends you to a web page called Add-ons under which you will find Themes, i.e. colors that you can colorize the table bar.

more options

It is certainly possible to change tab colours with userChrome.css. (I have done so.) I don't recall seeing any code to change toolbar colours (except for the address bar and search bar, which aren't actually toolbars) but I believe it is possible.

You could search the css repositories on github or ask on the FirefoxCSS sub of Reddit or the forums on mozillazine. org if you want help with code.

more options
more options

How does this feature work in Safari ? Can you attach a screenshot?

In Firefox you can use a theme to style the entire toolbar area with a background image or background color, no need to use userChrome.css for this.

more options

The tab bar in Safari changes color based on the website's meta theme in html (e.g. <meta... />) I want to find out if it is possible to do so ([https://css-tricks.com/meta-theme-col.../meta-theme-color-and-trickery/]) in Firefox using userChrome.css I know I can change themes and colors, but it would be cool to have it website dependent like in Safari.

more options

Have you posted this same question in a userChrome.css mac forum to see what others on the sites mentions as well? Because by default userChrome.css isn't a Firefox default load-that's user customization.

more options

I don't think you can do this with a normal userChrome.css rule. The reason is that rules operate hierarchically: the information needed to style a toolbar needs to be found at the same or a higher level of the HTML code, and the page is not part of the structure.

It looks like people have tried to make add-ons for this. Reviews are mixed: https://addons.mozilla.org/firefox/addon/adaptheme/. This one will try to figure out a good color if the site didn't set the meta tag: https://addons.mozilla.org/firefox/addon/adaptive-tab-bar-color/. I haven't tried any of those myself.

If you can't find a workable add-on, there is a kind of advanced hacking that loads script code during startup. This method has a better chance of being able to work because it doesn't have the same limitation as pure CSS. You could ask on r/FirefoxCSS whether anyone already has a script for this.

More information/references:

more options

See also:

  • 1706179 - Add support for <meta media> (for <meta name=theme-color>)

(please do not comment in bug reports
https://bugzilla.mozilla.org/page.cgi?id=etiquette.html
)

由cor-el于修改