Slack workspaces in the browser

I always try to avoid using Electron apps when I can, more so when I need them running all day like Slack. It doesn’t make much sense to me, it forces my computer to run another WebKit engine just for Slack when it already works perfectly in a browser….


This content originally appeared on DEV Community and was authored by Nicolas Beauvais

I always try to avoid using Electron apps when I can, more so when I need them running all day like Slack. It doesn't make much sense to me, it forces my computer to run another WebKit engine just for Slack when it already works perfectly in a browser.

But Slack does not offer a way to get all workspaces notifications in a single tab, and keeping 3-5 open tabs just for it is annoying, making the Electron app mandatory to use.

If you were stuck like me in this situation, I have exactly what you need: a way to activate Slack's workspace switcher in your web browser!

Slack's Workspaces switcher in the browser

All you need to make this work is to change your favourite browser's user agent to make Slack think that you are using a chromebook, as detailed in this stack exchange thread.

You can use the great Tampermonkey extension, or similar, to easily change your user agent on the Slack website. If you do not know about this extension, it allows you to run a user-defined script on a particular website, and more things outside this article's scope.

Once installed, you need to create the following script that will change your user agent, and make the Slack website think that you are running the latest Google Chrome version on a Chrome OS laptop:

// ==UserScript==
// @name        Enable Slack workspaces in the browser
// @namespace   slack.com
// @version     https://dev.to/nicolasbeauvais
// @description Enable Slack workspaces in the browser
// @match       https://app.slack.com/*
// @match       https://app.slack.com/
// @grant       none
// @run-at      document-start
// ==/UserScript==

(function () {
    'use strict';
    Object.defineProperty(navigator, 'userAgent', {
        value: 'Mozilla/5.0 (X11; CrOS x86_64 10066.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36'
    });
})();

If you never used Tampermonkey before, you can find many online tutorials that will show you how to add a script.

Be careful with the scripts that you add to Tampermonkey, you should never add code that you do not fully understand.

And that's it, you can now open all your Slack workspaces in a single tab, and receive all notifications, just like with the Electron app.


This content originally appeared on DEV Community and was authored by Nicolas Beauvais


Print Share Comment Cite Upload Translate Updates
APA

Nicolas Beauvais | Sciencx (2022-01-04T07:25:52+00:00) Slack workspaces in the browser. Retrieved from https://www.scien.cx/2022/01/04/slack-workspaces-in-the-browser/

MLA
" » Slack workspaces in the browser." Nicolas Beauvais | Sciencx - Tuesday January 4, 2022, https://www.scien.cx/2022/01/04/slack-workspaces-in-the-browser/
HARVARD
Nicolas Beauvais | Sciencx Tuesday January 4, 2022 » Slack workspaces in the browser., viewed ,<https://www.scien.cx/2022/01/04/slack-workspaces-in-the-browser/>
VANCOUVER
Nicolas Beauvais | Sciencx - » Slack workspaces in the browser. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/01/04/slack-workspaces-in-the-browser/
CHICAGO
" » Slack workspaces in the browser." Nicolas Beauvais | Sciencx - Accessed . https://www.scien.cx/2022/01/04/slack-workspaces-in-the-browser/
IEEE
" » Slack workspaces in the browser." Nicolas Beauvais | Sciencx [Online]. Available: https://www.scien.cx/2022/01/04/slack-workspaces-in-the-browser/. [Accessed: ]
rf:citation
» Slack workspaces in the browser | Nicolas Beauvais | Sciencx | https://www.scien.cx/2022/01/04/slack-workspaces-in-the-browser/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.