Skip to content

Instantly share code, notes, and snippets.

@Romern
Created March 30, 2018 10:03
Show Gist options
  • Save Romern/25e1f31e0b86ddb3f59b9f28b0b718af to your computer and use it in GitHub Desktop.
Save Romern/25e1f31e0b86ddb3f59b9f28b0b718af to your computer and use it in GitHub Desktop.
If you use only one channel in slack or your window is narrow, you may want to hide Slacks sidebar.
// ==UserScript==
// @name Slack: Hide sidebar
// @namespace http://userstyles.org
// @description Slack doesn't support narrow windows that good. This hides the sidebar.
// @author Roman Karwacik
// @run-at document-start
// @match https://*.slack.com/*
// @version 1
// ==/UserScript==
(function() {var css = [
".client_channels_list_container {display: none;}"
].join("\n");
if (typeof GM_addStyle != "undefined") {
GM_addStyle(css);
} else if (typeof PRO_addStyle != "undefined") {
PRO_addStyle(css);
} else if (typeof addStyle != "undefined") {
addStyle(css);
} else {
var node = document.createElement("style");
node.type = "text/css";
node.appendChild(document.createTextNode(css));
var heads = document.getElementsByTagName("head");
if (heads.length > 0) {
heads[0].appendChild(node);
} else {
// no head yet, stick it whereever
document.documentElement.appendChild(node);
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment