// ==UserScript== // @name Hide Twitch SideBar // @version 1.8.7 // @description hide twitch sidebar // @author raianwz // @match https://www.twitch.tv/* // @exclude *://player.twitch.tv/* // @exclude *://*.twitch.tv/p/* // @exclude *://*.twitch.tv/jobs/* // @exclude *://*.twitch.tv/subs/* // @exclude *://*.twitch.tv/embed/* // @exclude *://*.twitch.tv/store/* // @exclude *://*.twitch.tv/teams/* // @exclude *://*.twitch.tv/turbo/* // @exclude *://*.twitch.tv/popout/* // @exclude *://*.twitch.tv/moderator/* // @exclude *://*.twitch.tv/broadcast/* // @exclude *://*.twitch.tv/*/squad // @exclude *://*.twitch.tv/downloads* // @icon https://i.imgur.com/0GDybrZ.png // @run-at document-end // @license MIT // @namespace https://greasyfork.org/users/425245 // @downloadURL https://update.greasyfork.icu/scripts/404887/Hide%20Twitch%20SideBar.user.js // @updateURL https://update.greasyfork.icu/scripts/404887/Hide%20Twitch%20SideBar.meta.js // ==/UserScript== let getElement = (e) => document.querySelector(e); let arcnt = 0; document.addEventListener('readystatechange', (e) => { if (e.target.readyState === "complete") CheckBar(); }); function CheckBar() { if (arcnt >= 10) return; if (!document.getElementById('btnSideBar')) { LoadBar(); arcnt++; } } function LoadBar(){ const navSidebar = getElement(`[data-a-target="side-nav-bar-collapsed"]`) ?? getElement(`.side-nav--expanded`); const getBtnHideSide = localStorage.getItem('hidesdbar'); const setBtnHideSide = (value) => localStorage.setItem('hidesdbar', value); if (!navSidebar) return CheckBar(); navSidebar.style.display = "block"; let where = getElement('div.Layout-sc-1xcs6mc-0.fRzsnK'); const arrow = `