-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnissin_ps_optimize.user.js
More file actions
29 lines (28 loc) · 905 Bytes
/
nissin_ps_optimize.user.js
File metadata and controls
29 lines (28 loc) · 905 Bytes
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
// ==UserScript==
// @name Nissin Power Station [REBOOT] optimization
// @description Optimize chat room performance
// @version 1.0.0
// @include https://nissin-ps.com/live/*
// @run-at document-start
// @noframes
// ==/UserScript==
'use strict';
const observer = new MutationObserver(function (mutationList) {
for (const mutation of mutationList) {
if (mutation.type === "childList" && mutation.target.classList.contains("ultracheer-block")) {
if (mutation.target.childNodes.length > 50) {
let i = 0;
for (const child of mutation.target.childNodes.values()) {
i++;
if (i > 50) {
mutation.target.removeChild(child);
}
}
}
}
}
});
observer.observe(document, {
childList: true,
subtree: true,
});