Created
April 2, 2016 10:19
-
-
Save fourohfour/f2906dc5f94ee96f39885e899e716d4d 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 PeaceAndQuiet | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Speak freely in robin chats. | |
// @author DC-3 | |
// @match https://www.reddit.com/robin | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
setTimeout(function(){ | |
var target = document.querySelector('#robinChatMessageList'); | |
var observer = new MutationObserver(function(mutations) { | |
mutations.forEach(function(mutation) { | |
var msg = $(mutation.addedNodes[0].lastElementChild).text(); | |
if((!msg.startsWith('[')) && (!msg.startsWith('[robin]')) | |
) { | |
mutation.addedNodes[0].style.display = "none"; | |
} | |
}); | |
}); | |
observer.observe(target, {childList: true}); | |
}, 20); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment