Spot the ads while you search the web

I find that ads blend more and more into regular contents in web search results.

Ads can be of some use; well-targeted ads, based on your web search keywords for example, may prove spot-on. More over, they help with the funding of many web sites, the owners of which depend on ads to pay for the hosting, or to remunerate part of their work on free software.

Thus, I am not in some sort of crusade against ads. However, I want these to contrast with the main contents of the search results.

Cet article existe aussi en français.

Each web browser should allow its users to override the styles of visited web pages, mostly for accessibility reasons; in other words, it is possible to force the appearance of a web page to be different from what this page’s author has programmed.

In the case of Firefox, locate the profile you want to customize in your file-system, create a directory in this profile, named chrome (if it does not already exist), then create a file named userContent.css in this directory, with the following contents:

* Google ads on third-party sites: .gsc-adBlock, #adBlock
* Google for its own ads: .commercial-unit-desktop-rhs, .commercial-unit-desktop-top
* Google for regular ads: *.ads-ad
* Bing: .b_ad
* DuckDuckGo: #ads
* Yahoo: #main > * > .reg, #right > * > .reg
.gsc-adBlock, #adBlock, .commercial-unit-desktop-rhs, .commercial-unit-desktop-top, *.ads-ad, .b_ad, #ads, #main > * > .reg, #right > * > .reg {
font-size: 80% !important;
border: 1px solid red !important;
*.ads-ad {
border-top: 0px none !important;
border-bottom: 0px none !important;
*.ads-ad:first-child {
border-top: 1px solid red !important;
*.ads-ad:last-child {
border-bottom: 1px solid red !important;

Restart Firefox, and you’re done. From then on, ads will be written with slightly smaller characters than the rest of the page, and have a thin red border.

An application for managing profile can be installed if you need to discover what profiles are available. Under Linux, the profile is usually a sub-directory of ~/.mozilla/firefox/.

With another web browser, it should be enough to use the same CSS code as above (the contents of the userContent.css file), storing it wherever this browser’s manual tells you to; I did not try…

I will update this list if I have new information.


  • 2014-11-07 — Better CSS handling of Google ads.
  • 2015-07-01 — Ixquick changed the CSS id for their ads.
  • 2016-07-06 — Long-overdue global update.

Ajouter un commentaire

Le code HTML est affiché comme du texte et les adresses web sont automatiquement transformées.

La discussion continue ailleurs

URL de rétrolien :

Fil des commentaires de ce billet