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