userChrome.css not working (trying to block "Mozilla VPN" advertisements)
I do not wish to see advertisements for Mullvad on my Private Browsing new tab pages. But I can't even seem to opt out of them, as they remain even after searching "Sponsored" in about:preferences and unchecking all the applicable boxes. uBlock Origin also seemed unable to remove them, even with a custom filter and after enabling it on about-scheme.
So I went to fix it with userchrome CSS, by adding the following to a file named userChrome.css inside a folder named chrome inside my profile folder (after setting toolkit.legacyUserProfileCustomizations.stylesheets to True):
[code] /* Remove advertisements for Mozilla VPN */ @-moz-document url(about:privatebrowsing) { .promo { display: none !important; } } /code
However, even after restarting the browser, these advertisements are still present.
What am I doing wrong?
Giải pháp được chọn
That CSS code needs to be in userContent.css (webpages) and not in userChrome.css (user interface). Note that Web extensions do not work on about pages, so only userContent.css will work in cases like this.
Can you attach a screenshot that shows the promo in the Inspector ?
You can right-click and select "Inspect" to open the built-in Inspector with this element selected.
See also:
Đọc câu trả lời này trong ngữ cảnh 👍 1Tất cả các câu trả lời (2)
Firefox is a work in progress and, to allow for continuous innovation, Mozilla cannot guarantee future updates won’t impact your customizations. For this reason, Mozilla does not officially support style rules customization.
Please read Firefox Advanced Customization and Configuration Options to learn more.
Giải pháp được chọn
That CSS code needs to be in userContent.css (webpages) and not in userChrome.css (user interface). Note that Web extensions do not work on about pages, so only userContent.css will work in cases like this.
Can you attach a screenshot that shows the promo in the Inspector ?
You can right-click and select "Inspect" to open the built-in Inspector with this element selected.
See also: