Skip to content

Instantly share code, notes, and snippets.

@Sciss
Created September 29, 2015 10:44
Show Gist options
  • Select an option

  • Save Sciss/ea341d1e72c7497108c8 to your computer and use it in GitHub Desktop.

Select an option

Save Sciss/ea341d1e72c7497108c8 to your computer and use it in GitHub Desktop.
// ==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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment