-
Notifications
You must be signed in to change notification settings - Fork 0
/
migu.js
56 lines (48 loc) · 1.67 KB
/
migu.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
47
48
49
50
51
52
53
54
55
56
// ==UserScript==
// @name 咪咕比赛回放隐藏比分
// @namespace http://tampermonkey.net/
// @version 0.4
// @license MIT
// @description 隐藏咪咕视频回放
// @author wanwen
// @match https://www.miguvideo.com/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
function hideNumbers() {
var elements = document.querySelectorAll('.video-title, h1, h2');
var arabicNumeralPattern = /[0-9]/;
elements.forEach(function(element) {
if (arabicNumeralPattern.test(element.textContent)) {
element.style.display = 'none';
}
});
}
function hideEpisodeElement() {
var episodeElement = document.querySelector('.episode.fr');
if (episodeElement) {
episodeElement.style.display = 'none';
}
}
function zoomPage() {
document.body.style.zoom = "100%";
}
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
if (mutation.addedNodes && mutation.addedNodes.length > 0) {
// Call hideNumbers and hideEpisodeElement on each mutation to ensure elements are hidden
hideNumbers();
hideEpisodeElement();
}
});
});
var config = { childList: true, subtree: true };
// Start observing the body for changes in the DOM
observer.observe(document.body, config);
// Initial call to hide numbers, hide episode element, and set zoom
hideNumbers();
hideEpisodeElement();
zoomPage();
})();
// 咪咕视频比分隐藏油猴脚本,ai模型辅助生成