|
| 1 | +// ==UserScript== |
| 2 | +// @name Hide Twitch Content Disclosure |
| 3 | +// @namespace https://github.com/StaticPH |
| 4 | +// @match https://www.twitch.tv/* |
| 5 | +// @match https://www.twitch.tv/moderator/* |
| 6 | +// @match https://www.twitch.tv/popout/* |
| 7 | +// @match https://www.twitch.tv/videos/* |
| 8 | +// @exclude-match https://www.twitch.tv/videos |
| 9 | +// @exclude-match https://www.twitch.tv/directory* |
| 10 | +// @exclude-match https://www.twitch.tv/p/* |
| 11 | +// @exclude-match https://www.twitch.tv/downloads* |
| 12 | +// @exclude-match https://www.twitch.tv/jobs* |
| 13 | +// @exclude-match https://www.twitch.tv/settings* |
| 14 | +// @exclude-match https://www.twitch.tv/turbo* |
| 15 | +// @version 1.0 |
| 16 | +// @createdAt 6/29/2023 |
| 17 | +// @author StaticPH |
| 18 | +// @description Hides the stupid content disclosure overlay from the video player on Twitch.tv |
| 19 | +// @icon https://brand.twitch.tv/assets/logos/svg/glitch/purple.svg |
| 20 | +// @license MIT |
| 21 | +// @updateURL https://raw.githubusercontent.com/StaticPH/Userscripts/master/twitch_hide_content_disclosure.user.js |
| 22 | +// @downloadURL https://raw.githubusercontent.com/StaticPH/Userscripts/master/twitch_hide_content_disclosure.user.js |
| 23 | +// @homepageURL https://github.com/StaticPH/UserScripts |
| 24 | +// @supportURL https://github.com/StaticPH/UserScripts/issues |
| 25 | +// @grant GM.addStyle |
| 26 | +// @grant GM_addStyle |
| 27 | +// @run-at document-start |
| 28 | +// ==/UserScript== |
| 29 | + |
| 30 | +(function(){ |
| 31 | + 'use strict'; |
| 32 | + |
| 33 | + // Prefer asychronous Greasemonkey4-API GM.addStyle, but allow use of GM_addStyle as a fallback if necessary. |
| 34 | + if (typeof GM === 'undefined'){ |
| 35 | + this.GM = {}; |
| 36 | + } |
| 37 | + if (typeof GM['addStyle'] === 'undefined'){ |
| 38 | + console.log('GM.addStyle is not defined. Falling back to GM_addStyle Promise.'); |
| 39 | + GM['addStyle'] = function(...args){ |
| 40 | + return new Promise((onResolve, onReject) => { |
| 41 | + try{ onResolve(GM_addStyle.apply(this, args)); } |
| 42 | + catch(err){ onReject(err); } |
| 43 | + }); |
| 44 | + } |
| 45 | + } |
| 46 | + |
| 47 | + GM.addStyle ( ` |
| 48 | + #channel-player-disclosures { |
| 49 | + display: none; |
| 50 | + } |
| 51 | + ` |
| 52 | + ); |
| 53 | +})(); |
0 commit comments