How do I block ads on startpage.com?

10,373

Any idea how to solve this?

The ads in question are in a div with ID "spon_links".

<div id="spon_links">

You can use a Greasemonkey script to remove these divs.


Solution 1

This is confirmed as working in Firefox when using the uBlock Origin ad blocker.

// ==UserScript==
// @name        startpage.com remove ads
// @namespace   startpage.com
// @description Removes ads from startpage.com before they are displayed.
// @include     https://startpage.com/*
// @include     https://*.startpage.com/*
// @run-at      document-start
// @version     2015-09-29
// @grant       GM_addStyle
// ==/UserScript==

GM_addStyle("div#spon_links { display: none !important}");

Solution 2

Not tested.

Replace 'ads' with 'spon_links' in the example script below.

4.9. Removing an element

You can use Greasemonkey to remove entire chunks of a page in one fell swoop, with the removeChild function.

Example: Remove an ad sidebar

This presumes that there is an element whose ID is "ads".

var adSidebar = document.getElementById('ads');
if (adSidebar) {
    adSidebar.parentNode.removeChild(adSidebar);
}

Removing an element with removeChild will also remove all the content inside it. For example, if you remove a <table> element, this will also remove all of its table cells (<td> elements).

Source 4.9. Removing an element

Share:
10,373

Related videos on Youtube

Admin
Author by

Admin

Updated on September 18, 2022

Comments

  • Admin
    Admin almost 2 years

    I tried the following, it has no effect:

    startpage.com##[style*="background-color:#F5F9FF;"]
    

    Any idea how to solve this?

    To reproduce: Go to https://startpage.com/do/search - search for example for adblock. You'll see nasty light blue boxes at the top and bottom of the page reading "Ads related to adblock":

    enter image description here

    This is with Iceweasel (Firefox 38.2.1) and Adblock Edge 2.1.9.1.


    If it's not possible, which secure/privacy-respecting and ad-free sites do you recommend as alternative to IxQuick and Startpage?

  • Admin
    Admin over 8 years
    Thanks. Apparently it's either a bug in Adblock Edge or some counter action taken by the site. Because I just noticed that the ads are outside the div.spon_links when Adblock Edge is enabled. It does have a filter rule for spon_links. Perhaps there is some JS that moves the ol elements somewhere else when the spon_links is filtered.