-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathYoutube Stop Autoplay.user.js
29 lines (24 loc) · 1.13 KB
/
Youtube Stop Autoplay.user.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
// ==UserScript==
// @name YouTube Stop Autoplay
// @namespace https://github.com/johnnyawesome
// @version 1.0.8
// @description Stops YouTube from auto-playing videos
// @author JohnnyAwesome
// @match http://www.youtube.com/*
// @match https://www.youtube.com/*
// @grant none
// @icon https://raw.githubusercontent.com/johnnyawesome/MyLogo/master/MySkull32.ico
// @icon64 https://raw.githubusercontent.com/johnnyawesome/MyLogo/master/MySkull64.ico
// @updateURL https://raw.githubusercontent.com/johnnyawesome/YouTubeStopAutoplay/master/Youtube%20Stop%20Autoplay.user.js
// @downloadURL https://raw.githubusercontent.com/johnnyawesome/YouTubeStopAutoplay/master/Youtube%20Stop%20Autoplay.user.js
// @noframes
// ==/UserScript==
'use strict';
setInterval(turnAutoplayOff, 10000);
function turnAutoplayOff(){
console.log("Status of Autoplay:", document.getElementById("toggle").getAttribute("aria-pressed"));
if(document.getElementById("toggle").getAttribute("aria-pressed") == 'true'){
console.log("Autoplay is turned on. Turning it off.")
document.getElementById("toggle").click();
}
}