Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fourohfour/f2906dc5f94ee96f39885e899e716d4d to your computer and use it in GitHub Desktop.
Save fourohfour/f2906dc5f94ee96f39885e899e716d4d to your computer and use it in GitHub Desktop.
// ==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