Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

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

  • 2 replies
  • 1 has this problem
  • 40 views
  • Last reply by 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?
Attached screenshots

Chosen solution

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:

Read this answer in context 👍 1

All Replies (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

Chosen Solution

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: