Skip to content

Instantly share code, notes, and snippets.

@jeffhorton
Last active December 29, 2017 18:25
Show Gist options
  • Save jeffhorton/dea1cd85d68bb98e216b851961aba204 to your computer and use it in GitHub Desktop.
Save jeffhorton/dea1cd85d68bb98e216b851961aba204 to your computer and use it in GitHub Desktop.
Slack Hide User
javascript:(function(){window.rl = window.rl || []; function rlfunc() { $('span.message_sender, a.member').each(function (i, j) { for (var i = 0; i < window.rl.length; i++) { var re = new RegExp(rl[i], "ig"); if (j.className.match(re) || j.textContent.match(re)) { j.closest('ts-message').remove(); console.log('removing', re); } else { console.log('no match', re, j.className); } } } ) } var u = prompt('user partial'); if (u != null) { window.rl.push(u); console.log(window.rl); rlfunc() }; $('body').remove('DOMSubtreeModified', rlfunc()); $('body').on('DOMSubtreeModified', rlfunc());})();
@jeffhorton
Copy link
Author

Use as a bookmarklet.

  • Prompts for a bit of the user name
  • Removes that users messages from current history view
  • New messages will run remove function

@erikyuzwa
Copy link

excellent. very handy thanks!

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