Created
April 3, 2009 20:39
-
-
Save tghw/89953 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Remove viewed stories & block domains | |
| // @namespace nothing | |
| // @include http://reddit.com/* | |
| // @include http://*.reddit.com/* | |
| // ==/UserScript== | |
| var site_blacklist = /imgur.com|holytaco.com/ig; | |
| function main() | |
| { | |
| $('head').append('<style type="text/css">a:visited{z-index:666;}</style>'); | |
| //perform action on visited links | |
| $('.entry > .title a').each(function() { | |
| if($(this).css('zIndex') == '666') | |
| { | |
| $(this).parents('.thing').css({opacity: 0.5, backgroundColor: 'white'}); | |
| } | |
| if($(this).parent().find('.domain').text().match(site_blacklist)) | |
| { | |
| $(this).parents('.thing').remove(); | |
| } | |
| }); | |
| $('.entry > .title a').mousedown(function(){ | |
| $(this).parents('.thing').css({opacity: 0.5, backgroundColor: 'white'}); | |
| }); | |
| } | |
| // Check if jQuery's loaded | |
| function GM_wait() { | |
| if(typeof unsafeWindow.jQuery == 'undefined') { window.setTimeout(GM_wait,100); } | |
| else { $ = unsafeWindow.jQuery; main(); } | |
| } | |
| GM_wait(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment