-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclean-ui.user.js
More file actions
44 lines (37 loc) · 1.06 KB
/
clean-ui.user.js
File metadata and controls
44 lines (37 loc) · 1.06 KB
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
// ==UserScript==
// @name Clean UI
// @version 0.2
// @downloadURL https://userscripts.codonaft.com/clean-ui.user.js
// @require https://userscripts.codonaft.com/utils.js
// @match https://*.invidious.*/*
// @match https://*.telegram.org/*
// @match https://*.youtube.com/*
// ==/UserScript==
(_ => {
'use strict';
if (performance.getEntriesByType('navigation')[0]?.responseStatus !== 200) return;
const h = window.location.hostname;
const hide = node => node.style.display = 'none';
if (h.endsWith('telegram.org')) {
subscribeOnChanges(document.body, 'div.badge-gray', (node, _observer) => {
hide(node);
return false;
});
}
if (h.endsWith('youtube.com')) {
subscribeOnChanges(document.body, 'img.ytd-yoodle-renderer', (node, observer) => {
observer.disconnect();
hide(node);
return false;
});
}
if (h.includes('invidious')) {
subscribeOnChanges(document.body, 'div.h-box', (node, observer) => {
if (node.textContent?.includes?.('Play next by default')) {
observer.disconnect();
hide(node);
}
return false;
});
}
})();