2012年4月23日 星期一

Lab18 Clean Language

1.用右鍵點選  Clean Language 並且按另存新檔

2. 用記事本打開 此檔案            3.再將 ,'***' 加入JavaScript 


  
// ==UserScript==
// @name          Clean Language
// @namespace     http://arantius.com/misc/greasemonkey/
// @description      Keep bad words off of the web.  Edit the array badwords to control which words are removed from pages and replaced with ***.
// @require     http://arantius.com/misc/greasemonkey/imports/content-scope-runner.user.js
// ==/UserScript==

//
// Originally written by Anthony Lieuallen of http://arantius.com/
// Licensed for unlimited modification and redistribution as long as
// this notice is kept intact.
//
// If possible, please contact me regarding new features, bugfixes
// or changes that I could integrate into the existing code instead of
// creating a different script.  Thank you
//

(function() {
//edit the words here but ...
var badwords=['cawk','123','chink','clits','cock','cum','cunt','dago','daygo','dego','dick','dildo','fag','fcuk','feces','feg','foreskin','fu','fuk','fux0r','gay','gook','h0r','h4x0r','hoer','hoer','honkey','hore','kawk','kike','kuk','kuksuger','lesbian','lesbo','masturbat','motherfucker','nigga','nigger','penis','phuck','piss','pr0n','prick','pusse','pussy','vagina','queef','queer','qweef','scrotum','sh!t','shemale','shiz','slut','smut','spic','teets','testicles','tits','titties','titty','twat','twaty','wank','whoar','whore','wtf','bitch','bastard','damn','shit','fuck','ass','asshole','jackass'];

//do not touch anything below here
var bw="\\b("+badwords.join("|")+")\\b";
bw=new RegExp(bw, "gi");

var els = document.evaluate('//*', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
var el,i=0;
while (el=els.snapshotItem(i++)) {
    //don't mess with these tags
    if ('SCRIPT'==el.tagName) continue;
    if ('STYLE'==el.tagName) continue;

    for (var j=0; j<el.childNodes.length; j++) {
        if ('#text'==el.childNodes[j].nodeName) {
            el.childNodes[j].textContent=el.childNodes[j].textContent.replace(bw, '***');
        }
    }
}
document.title=document.title.replace(bw, '***');
})
();



4.將檔案丟入 火狐 瀏覽器 搜尋 *** 

沒有留言:

張貼留言