NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name HideSquadBanner // @namespace https://openuserjs.org/users/Gibbu // @version 1.0.0 // @copyright 2019, Gibbu (https://openuserjs.org/users/Gibbu) // @license MIT // @supportURL https://github.com/Gibbu/OpenUserJs-Scipts/issues/new // @description Allows for the squad banner to be hidden. // @author Gibbu // @match *://*.twitch.tv/* // @grant GM_addStyle // ==/UserScript== // ==OpenUserJs== // @author Gibbu // @updateURL https://openuserjs.org/meta/Gibbu/HideSquadBanner.meta.js // ==/OpenUserJs== GM_addStyle('.dismiss-button {font-size:18px;font-weight:bold;cursor:pointer;margin-right:8px;}'); var dismiss = document.createElement('div'); dismiss.setAttribute('class', 'dismiss-button'); dismiss.innerHTML = '×'; var i = 0; var checkBanner = setInterval(function() { i++; if(document.body.contains(document.querySelector('[data-a-target="squad-stream-banner-button"]'))) { document.querySelector('[data-a-target="squad-stream-banner-button"]').closest('.tw-pd-1').appendChild(dismiss); dismiss.addEventListener('click', function() { this.closest('[data-a-target="tw-animation-target"]').remove(); document.querySelector('.persistent-player').style.top = '0'; }); stopInterval(checkBanner); } if (i == 10) { stopInterval(checkBanner); } }, 1000); var stopInterval = function(target) { clearInterval(target); };