Skip to content

Commit ed554d0

Browse files
committed
Update
1 parent 2876c54 commit ed554d0

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

clean-ui.user.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// ==UserScript==
2+
// @name Clean UI
3+
// @version 0.1
4+
// @downloadURL https://userscripts.codonaft.com/clean-ui.user.js
5+
// @require https://userscripts.codonaft.com/utils.js
6+
// @match https://*.youtube.com/*
7+
// @match https://*.telegram.org/*
8+
// ==/UserScript==
9+
10+
(_ => {
11+
'use strict';
12+
13+
if (performance.getEntriesByType('navigation')[0]?.responseStatus !== 200) return;
14+
15+
const h = window.location.hostname;
16+
17+
const hide = node => node.style.display = 'none'; // TODO: extract
18+
19+
if (h.endsWith('telegram.org')) {
20+
subscribeOnChanges(document.body, 'div.badge-gray', (node, _observer) => {
21+
hide(node);
22+
return false;
23+
});
24+
}
25+
26+
if (h.endsWith('youtube.com')) {
27+
subscribeOnChanges(document.body, 'img.ytd-yoodle-renderer', (node, observer) => {
28+
observer.disconnect();
29+
hide(node);
30+
return false;
31+
});
32+
}
33+
})();

0 commit comments

Comments
 (0)