Created
September 3, 2009 14:25
-
-
Save negipo/180327 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name FavotterUncensored | |
// @namespace http://polog.org/ | |
// @include http://favotter.matope.com/* | |
// @require http://gist.github.com/3242.txt | |
// @require http://dl.getdropbox.com/u/275354/lib/favotter_denied_keywords.js | |
// ==/UserScript== | |
var denied_keywords = favotter_denied_keywords(); | |
var denied_keywords_length = denied_keywords.length; | |
function init(doc){ | |
$X('descendant-or-self::span[@class="censored"]', doc).forEach(function(e){ | |
uncensored(e, Math.floor(Math.random() * denied_keywords_length)); | |
}); | |
} | |
function uncensored(e, i){ | |
if(i >= denied_keywords_length) | |
i = 0; | |
e.innerHTML = denied_keywords[i]; | |
setTimeout(function(){uncensored(e, i+=1)}, 100); | |
} | |
init(document); | |
document.body.addEventListener('AutoPagerize_DOMNodeInserted',function(evt){ | |
var doc = evt.target; | |
init(doc); | |
}, false); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment