Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Tìm hiểu thêm

userChrome.css not working (trying to block "Mozilla VPN" advertisements)

  • 2 trả lời
  • 1 gặp vấn đề này
  • 1 lượt xem
  • Trả lời mới nhất được viết bởi cor-el

more options

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?

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?
Đính kèm ảnh chụp màn hình

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 👍 1

Tất cả các câu trả lời (2)

more options

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.

more options

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: