如何使用用户Chrome.css设置火狐浏览器URL栏的背景颜色?



我正在尝试使用userChrome.css更改Firefox URL栏的背景颜色。按照这些步骤,我将以下代码添加到我的userChrome.css(在<profile>/chrome中):

@-moz-document url(chrome://browser/content/browser.xul),
url(chrome://browser/content/browser.xhtml) {
#urlbar {
background-color: red !important;
}
}

它根本不起作用。我怎么才能做到呢?

首先,您需要将about:config中的toolkit.legacyUserProfileCustomizations.stylesheetspreference设置为true,如下所示。

现在,要使用的正确的CSS标识符是#urlbar-background:
@-moz-document url(chrome://browser/content/browser.xul),
url(chrome://browser/content/browser.xhtml) {
#urlbar-background{
background-color: red !important;
}
}

(I learned that from this file;整个存储库很有指导意义。)

最新更新