forked from lovmoon3k/useful-script
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyoutube_toggleLight.js
29 lines (27 loc) · 972 Bytes
/
youtube_toggleLight.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
export default {
icon: "https://lh3.googleusercontent.com/Apmrldj2Vnje0MIEvqYslaGRjDj2R3u72YboNiUHJ8sSORBmLCYJNJ50FTCFhXrCuXs3e6vaCTJqOKeq-I3AMkIFLw=w128-h128-e365-rj-sc0x00ffffff",
name: {
en: "Toggle light youtube",
vi: "Tắt/Mở đèn youtube",
},
description: {
en: "Toggle light on/off to focus to youtube video",
vi: "Tắt/Mở đèn để tập trung xem video youtube",
},
blackList: [],
whiteList: ["*://www.youtube.com/*"],
func: function () {
["#below", "#secondary", "#masthead-container"].forEach((_) => {
let doms = document.querySelectorAll(_);
Array.from(doms).forEach((dom) => {
let current = dom.style.opacity || 1;
let newValue = current == 1 ? 0 : 1;
dom.style.opacity = newValue;
dom.style.pointerEvents = newValue ? "" : "none";
});
});
document.querySelector("#player-theater-container")?.scrollIntoView?.({
behavior: "smooth",
});
},
};