Following @DavidPostill's notice, I looked again at the page structure. It appears that the text ads are moved outside the div.spon_links
when Adblock Edge is enabled which indeed has a filtering rule for spon_links
. Whether this is a misbehaviour of Adblock Edge or some counter-action from Startpage I don't know.
There is a simpler solution than adding a custom Greasemonkey script—simply swapping Adblock Edge for uBlock also solved the problem.
On further investigation, the ads only disappear with uBlock enabled when Adblock Edge is entirely disabled at the same time ("Disable everywhere"). Even if I disable it only for Startpage ("Disable on startpage.com"), the site moves the ads outside the spon_links
container. My explanation is that Startpage somehow manages to access my Add-ons preferences and checks if Adblock is generally enabled. Could it be that nasty?!
Using David's approach of Greasemonkey and removeChild
, I came up with the following solution that still works when Adblock Edge is installed. It seems one has to wait till the page has loaded and toyed around with avoiding ad-block, until you can finally locate and delete the offending elements:
// ==UserScript==
// @name startpage/ixquick remove ads
// @namespace startpage.com
// @description Removes ads from startpage/ixquick before they are displayed.
// @include https://startpage.com/*
// @include https://*.startpage.com/*
// @include https://ixquick.com/*
// @include https://*.ixquick.com/*
// @run-at document-end
// @grant none
// @version 2015-09-29
// ==/UserScript==
var fun = function() {
var results = document.getElementById('bottom-result-container');
if (results) {
var ols = results.getElementsByTagName('ol');
for (i = 0; i < ols.length; i++) {
var ol = ols[i];
var ps = ol.getElementsByTagName('p');
for (j = 0; j < ps.length; j++) {
var p = ps[j];
if (p.className == 'head2') {
var spans = p.getElementsByTagName('span');
for (k = 0; k < spans.length; k++) {
if (spans[k].innerHTML.contains("Ads related to")) {
ol.innerHTML = '';
}
}
}
}
}
}
};
setTimeout(fun, 1);
(Sorry, my JavaScript is a bit rusty, probably easier with jQuery.)
If you don't mind using greasemonkey see my answer below. – DavidPostill – 2015-09-29T09:14:15.300
I couldn't find the ads displayed in Chrome with Adblock installed. Even if I disable Adblock extension I could see the text that were being displayed in your screenshot. :/ So, my guess is that one of the extensions that you are using in injecting the ads in that page. Could you disable all the extensions, restart your browser and check again. – Lucky – 2015-09-29T09:16:44.030
2I honestly don't see the problem with Google; all websites track you anyway (whether you like it or not, that's how the Internet works), and there's hardly any advertising (apart from Sponsored Links, which you simply ignore). – AStopher – 2015-09-29T13:35:39.610