Skip to content

Instantly share code, notes, and snippets.

@tekkub
Created November 8, 2009 01:41
Show Gist options
  • Save tekkub/229021 to your computer and use it in GitHub Desktop.
Save tekkub/229021 to your computer and use it in GitHub Desktop.
Google domain blacklist
// ==UserScript==
// @name Google domain blacklist
// @namespace http://www.google.com
// @description Removes results for specific domains from google.
// @include http://www.google.com/search*
// @include http://www.google.co.uk/search*
// ==/UserScript==
var blacklist = new Array("experts-exchange.com", "torrentreactor.to");
for (domain in blacklist) {
var results = document.evaluate('//a[contains(@href, "' + domain + "/")]/..', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
for (var result=null, i=0; result=results.snapshotItem(i); i++) {result.style.display='none';}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment