-
Notifications
You must be signed in to change notification settings - Fork 0
/
content.js
41 lines (28 loc) · 1.02 KB
/
content.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
const interval = setInterval(()=>{
const header = document.querySelector("._1QUKR");
if(header){
console.log(header);
clearInterval(interval);
const button = document.createElement("button");
button.innerHTML = " 2x";
button.classList.add("twoTimesButtonOff");
button.addEventListener("click", ()=> {
const audios = document.querySelectorAll("audio");
console.log(audios);
audios.forEach((audio) => {
if (audio.playbackRate == 2){
audio.playbackRate = 1;
console.log(audio.playbackRate);
button.classList.remove("twoTimesButtonOn")
button.classList.add("twoTimesButtonOff");
} else {
button.classList.remove("twoTimesButtonOff")
button.classList.add("twoTimesButtonOn");
audio.playbackRate = 2;
console.log(audio.playbackRate);
}
})
})
header.appendChild(button);
}
}, 1000)