-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjitsi-podcaster.user.js
More file actions
44 lines (35 loc) · 1.34 KB
/
jitsi-podcaster.user.js
File metadata and controls
44 lines (35 loc) · 1.34 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 Jitsi in Tile Mode for Podcasting
// @icon https://external-content.duckduckgo.com/ip3/jitsi.org.ico
// @version 0.19
// @downloadURL https://userscripts.codonaft.com/jitsi-podcaster.user.js
// @require https://userscripts.codonaft.com/utils.js
// ==/UserScript==
(_ => {
'use strict';
if (performance.getEntriesByType('navigation')[0]?.responseStatus !== 200) return;
if (!document.head?.querySelector('meta[itemprop="name"][content="Jitsi Meet"]')) return;
const b = document.body;
if (!b) return;
const hiddenNodes = 'a.watermark.leftwatermark[href="https://jitsi.org"], div.audioindicator-container, div.bottom-indicators, div.details-container';
const someHiddenNodes = 'span.videocontainer';
const hide = node => node.style.display = 'none';
subscribeOnChanges(b, `${hiddenNodes}, ${someHiddenNodes}`, (node, _observer) => {
if (node.matches(hiddenNodes)) {
hide(node);
return false;
}
if (node.matches(someHiddenNodes)) {
if (node.classList.contains('display-video') && node.children.length >= 5) {
[3, 4].forEach(i => hide(node.children[i]));
}
const classList = node.classList || [];
const activeSpeaker = [...classList].find(i => i.endsWith('-activeSpeaker'));
if (activeSpeaker) {
node.classList.remove(activeSpeaker);
}
return false;
}
return true;
});
})();