Use Tampermonkey for Chrome or Greasemonkey for Firefox
- Blocks most vote spam
- Double click usernames to block them in future
- no "setInterval" so no flicker or lag!
Click [Raw] (right below from here) to install.
Use Tampermonkey for Chrome or Greasemonkey for Firefox
Click [Raw] (right below from here) to install.
// ==UserScript== | |
// @name Unicorn Robin "ad"block | |
// @namespace UnicornRobinAdblock | |
// @version 0.1 | |
// @description block that shit. | |
// @author unicorntrash | |
// @match https://www.reddit.com/robin/ | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var blocked = []; | |
$(".footer-parent").prepend('<p><a href="https://gist.github.com/b1nary/4c7c4e56a92bec5ebb9340dbf07d8b21">Unicorn Robin "ad"block</a>: Doubleclick username to block.</p><br>') | |
$(function(){ | |
$(document).bind('DOMNodeInserted', function(e) { | |
var target = $(e.target); | |
var message = target.find('.robin-message--message').text(); | |
var username = target.find('.robin--username').text(); | |
if($.inArray(username, blocked) !== -1){ | |
target.remove(); | |
} | |
if(message.indexOf('Robin-Grow') > -1 || | |
message.indexOf('Robin Autovoter') > -1 || | |
message.indexOf('voted to ') > -1){ | |
target.remove(); | |
} | |
}); | |
$(document).on('dblclick', '.robin--username', function(){ | |
console.log("Now blocking: "+$(this).text()); | |
blocked.push($(this).text()); | |
localStorage.robin_unicorn_blocked = JSON.stringify(blocked); | |
}); | |
if(localStorage.robin_unicorn_blocked){ | |
blocked = JSON.parse(localStorage.robin_unicorn_blocked); | |
} | |
console.log("Unicorn Robin Adblock loaded"); | |
}); | |
})(); | |