移除新的 Firefox 自动填充颜色 [英] Remove new Firefox autofill color
问题描述
几天前,我的 Firefox 开发者版更新到了 67.0b2(64 位)版本.从那时起,几乎每个网站上的所有自动填充输入字段都有黄色背景.
A few days ago my Firefox Developer Edition updated to version 67.0b2 (64 bit). Since then all autofilled input fields have a yellow background, on literally every website.
如何去除黄色的自动填充颜色?
How can I get rid of the yellow autofill color?
更改插入框阴影颜色似乎不像在 Chrome 中那样起作用.
Changing inset box-shadow color doesn't seem to work like it does in Chrome.
推荐答案
Firefox 94 及更新版本
只需在您的 css 中更改输入的背景颜色:
Firefox 94 and newer
Just change the input's background color in your css:
input:autofill {
background: #fff; /* or any other */
}
如果您只想在 Firefox 浏览器中删除自动填充背景,请在 about:config
中将 layout.css.autofill.background
设置为 false
代码>.
If you wish to remove the autofill background only in your Firefox browser, set layout.css.autofill.background
to false
in about:config
.
将此添加到您的 css:
Add this to your css:
input {
filter: none;
}
为什么?在 view-source:resource://gre-resources/forms.css
的底部我们可以看到:
Why? At the bottom of view-source:resource://gre-resources/forms.css
we can see this:
:-moz-autofill, :-moz-autofill-preview {
filter: grayscale(21%) brightness(88%) contrast(161%) invert(10%) sepia(40%) saturate(206%);
}
这就是黄色自动填充背景颜色的原因.
And that is the cause of the yellow autofill background color.
这篇关于移除新的 Firefox 自动填充颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!