This is a JavaScript one-liner that works in the Slack web interface.
// this code is a work in progress
document.querySelectorAll('*').forEach(element =>
element.addEventListener('scroll', () =>
Array.from(document.querySelectorAll('div.c-virtual_list__item'))
.filter(element => RegExp('some-username').test(element.textContent))
.forEach(element => (element.style.display = 'none'))
)
);
In Firefox, I paste this one-liner into the Web Console to mute any user with whom I temporarily want to be less spontaneous and more intentional. Notifications still come through.
Shortcut:
- Ctrl+Shift+K
- Ctrl+V
- ENTER