Skip to content

Commit 1a9fd43

Browse files
committed
Add new userscript: twitch_hide_content_disclosure.user.js
1 parent c2729c3 commit 1a9fd43

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed

README.md

+12
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ To add a script:
3838
| [Youtube Channel Keyboard Protection](#YCKP) | [install][raw-YCKP] | N/A | :heavy_check_mark: | MIT | 2021:11:13 | 2022:05:01 |
3939
| [Twitch Hide Channel Leaderboard](#THCL) | [install][raw-THCL] | N/A | :heavy_check_mark: | MIT | 2020:06:19 | 2022:08:19 |
4040
| [Twitch Transparent Video Stats](#TTVS) | [install][raw-TTVS] | N/A | :heavy_check_mark: | MIT | 2021:05:19 | 2022:08:19 |
41+
| [Twitch Hide Content Disclosure](#THCD) | [install][raw-THCD] | N/A | :heavy_check_mark: | MIT | 2023:06:29 | 2023:06:29 |
4142
| [GitHub Repo Network Tab](#GRNT) | [install][raw-GRNT] | N/A | :heavy_check_mark: | MIT | 2020:04:06 | 2023:06:10 |
4243
| [Bigger GitHub Network Graph](#BGNG) | [install][raw-BGNG] | N/A | :heavy_check_mark: | MIT | 2020:04:12 | 2021:10:28 |
4344
| [GitHub Notification Page Tweaks](#GNPT) | [install][raw-GNPT] | N/A | :heavy_check_mark: | MIT | 2020:10:22 | 2021:08:03 |
@@ -135,6 +136,16 @@ Makes the video stats overlay on Twitch.tv video player partially transparent, s
135136

136137
---
137138

139+
<a name="THCD"></a>
140+
### Twitch Hide Content Disclosure
141+
142+
Hides the stupid content disclosure overlay from the Twitch.tv video player.<br>
143+
Extensions like FrankerFaceZ may already have this functionality.
144+
145+
[[Install]][raw-THCD]
146+
147+
---
148+
138149
<a name="GRNT"></a>
139150
### GitHub Repo Network Tab
140151

@@ -520,6 +531,7 @@ As explained on <https://stackoverflow.com/questions/7653483/github-relative-lin
520531
[raw-YCKP]: /youtube_channel_keyboard_protector.user.js?raw=1
521532
[raw-THCL]: /twitch_hide_channel_leaderboard.user.js?raw=1
522533
[raw-TTVS]: /twitch_transparent_video_stats.user.js?raw=1
534+
[raw-THCD]: /twitch_hide_content_disclosure.user.js?raw=1
523535
[raw-GRNT]: /github_repo_network_tab.user.js?raw=1
524536
[raw-BGNG]: /bigger_github_network_graph.user.js?raw=1
525537
[raw-GNPT]: /github_notification_page_tweaks.user.js?raw=1
+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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

Comments
 (0)