Skip to content

Instantly share code, notes, and snippets.

@olsososo
Created January 21, 2014 08:59
Show Gist options
  • Save olsososo/8536623 to your computer and use it in GitHub Desktop.
Save olsososo/8536623 to your computer and use it in GitHub Desktop.
过滤某些网站
// ==UserScript==
// @name test
// @namespace test
// @include http://nodejs.org/api/dns.html
// @version 1
// @grant none
// ==/UserScript==
(function(){
var blacklistSite = ["baidu"];
var blacklistTitle = ["google","hupu"];
for(i in blacklistSite)
{
if(eval("/"+blacklistSite[i]+"/gi").test(location.href)){
console.log("blacklistSite!");
return;
}
}
for(i in blacklistTitle)
{
if(eval("/"+blacklistTitle[i]+"/gi").test(document.title)){
console.log("blacklistTitle");
return;
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment