Skip to content

Instantly share code, notes, and snippets.

@esmevane
Created April 1, 2016 18:55
Show Gist options
  • Select an option

  • Save esmevane/8b71fdfcae86bc54d4e23c645eba7e5b to your computer and use it in GitHub Desktop.

Select an option

Save esmevane/8b71fdfcae86bc54d4e23c645eba7e5b to your computer and use it in GitHub Desktop.
[ Robin / Javascript ]: Ignore annoying Robin users
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)
@esmevane
Copy link
Copy Markdown
Author

esmevane commented Apr 1, 2016

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")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment