---
type: article
url: 'https://taylordrayson.com/2026/09/21/slack-open-in-browser-userscript'
title: 'Slack open in browser userscript'
date: '2026-09-21T12:57:04+01:00'
fields:
  article: 'Slack open in browser userscript'
---

# Slack open in browser userscript

I despise Slack very much and try to use it as little as possible. Sometimes, however, I have no choice but to message a colleague or a friend, so I refuse to download the Slack app because I don't…

I despise Slack very much and try to use it as little as possible. Sometimes, however, I have no choice but to message a colleague or a friend, so I refuse to download the Slack app because I don't want it open all the time. One thing that really annoyed me was that whenever you clicked on a Slack channel from the main Slack homepage, it would do two things:

1. It would try to open Slack in the app, which I didn't have installed, so it would require me to click "Open in Browser" or "Continue in Browser."

1. It would open Slack workspaces in a new tab, which was very frustrating because I don't need the Slack homepage open in my browser.

I wrote a small userscript that bypasses and disables the new tab opening and automatically clicks the "Continue in Browser" button when it appears.

```
// ==UserScript==
// @name         Slack Browser UX Enhancements
// @description  Keeps Slack in the browser and prevents workspace links opening new tabs
// @version      1.0.1
// @author       @tdrayson
// @namespace    https://github.com/tdrayson/userscripts
// @match        https://*.slack.com/*
// @match        https://*.slack.com/ssb/redirect*
// @match        https://*.slack.com/archives/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=slack.com
// @run-at       document-end
// @grant        none
// ==/UserScript==

(function () {
  'use strict';

  const textVariations = [
    'use slack in your browser',
    'open in browser',
    'continue in browser',
    'stay in browser',
    'open this link in your browser',
  ];

  let browserLinkClicked = false;

  function disableNewTabOpening() {
    const links = document.querySelectorAll(
      'a.ss-c-workspace-detail__action, a.workspace-list-item'
    );

    if (links.length === 0) return;

    links.forEach((link) => {
      if (link.target === '_blank') {
        link.target = '_self';
      }
    });
  }

  function clickBrowserLink() {
    if (browserLinkClicked) return;

    const links = document.querySelectorAll('a');

    for (const link of links) {
      const text = (link.textContent || '').toLowerCase().trim();
      if (!text) continue;

      if (textVariations.some((variant) => text.includes(variant))) {
        link.click();
        browserLinkClicked = true;
        break;
      }
    }
  }

  window.addEventListener('load', disableNewTabOpening);

  const observer = new MutationObserver(() => {
    disableNewTabOpening();
    clickBrowserLink();
  });

  if (document.body) {
    observer.observe(document.body, {
      childList: true,
      subtree: true,
    });
  }

  clickBrowserLink();
})();
```

## See also

- All articles: [Articles](https://taylordrayson.com/articles)
- That day: [21 September 2026](https://taylordrayson.com/2026/09/21)
- Tagged: [Slack](https://taylordrayson.com/tags/slack)
- Tagged: [Userscripts](https://taylordrayson.com/tags/userscripts)
