-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathYouTubeStudioEnacerList_include.js
46 lines (42 loc) · 1.59 KB
/
YouTubeStudioEnacerList_include.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
// ==UserScript==
// @name YouTube Studio Enhancer List
// @namespace youtube
// @version 0.01
// @description A tooling to make YouTube Studio much better
// @author You
// @match https://studio.youtube.com/channel/UCCP6P-4slm9zxgtT6NoJ2ag/videos/upload*
// @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// @require https://raw.githubusercontent.com/Rockatweb/YouTube-Studio-Enhancer/refs/heads/main/YouTubeStudioEnhancerList.js
// @grant GM_xmlhttpRequest
// @grant GM_getResourceText
// @grant GM_addStyle
// @run-at document-start
// ==/UserScript==
(function () {
'use strict';
function addScriptToHead(scriptContent) {
const headElement = document.querySelector('head');
if (headElement) {
const scriptElement = document.createElement('script');
scriptElement.innerHTML = scriptContent;
headElement.appendChild(scriptElement);
} else {
const observer = new MutationObserver((mutations) => {
if (document.head) {
observer.disconnect();
const scriptElement = document.createElement('script');
scriptElement.innerHTML = scriptContent;
document.head.appendChild(scriptElement);
}
});
observer.observe(document.documentElement, { childList: true, subtree: true });
}
}
GM_xmlhttpRequest({
method: 'GET',
url: 'https://raw.githubusercontent.com/Rockatweb/YouTube-Studio-Enhancer/refs/heads/main/YouTubeStudioEnhancerList.js',
onload: (ev) => {
addScriptToHead(ev.responseText);
},
});
})();