Created
April 1, 2016 18:55
-
-
Save esmevane/8b71fdfcae86bc54d4e23c645eba7e5b to your computer and use it in GitHub Desktop.
[ Robin / Javascript ]: Ignore annoying Robin users
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
| var ignoreList = {}; | |
| function remove(username) { | |
| var slice = Array.prototype.slice; | |
| var messages = slice.call(document.querySelectorAll('.robin-message')); | |
| messages.forEach(function(message) { | |
| var messageFrom = message.querySelector('.robin-message--from'); | |
| if (messageFrom) { | |
| var user = messageFrom.innerText; | |
| if (user.toLowerCase() === username.toLowerCase()) { message.remove(); } | |
| } | |
| }) | |
| } | |
| function removeIgnore(username) { delete ignoreList[username.toLowerCase()] } | |
| function addIgnore(username) { ignoreList[username.toLowerCase()] = true } | |
| function removeIgnoreList() { | |
| for (var username in ignoreList) { remove(username) } | |
| } | |
| setInterval(removeIgnoreList, 65) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Open up your console, and paste the above code to get a poor man's ignore list for your Robin chat experience.
To add a user, type
addIgnore("UserName"). If you want to remove them,removeIgnore("UserName")