Archived post: posted sometime between 2016 and 2022.

Temporarily mute/hide a specific user in a channel in the Slack web interface.

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:

  1. Ctrl+Shift+K
  2. Ctrl+V
  3. ENTER