From 9935d519409aa6e99ff38fb3da4de6348f05c5df Mon Sep 17 00:00:00 2001 From: Johnny Awesome <35241451+johnnyawesome@users.noreply.github.com> Date: Fri, 19 Apr 2019 20:21:14 +0200 Subject: [PATCH] Update Youtube Stop Autoplay.user.js --- Youtube Stop Autoplay.user.js | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/Youtube Stop Autoplay.user.js b/Youtube Stop Autoplay.user.js index 579d039..c704df6 100644 --- a/Youtube Stop Autoplay.user.js +++ b/Youtube Stop Autoplay.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Youtube Stop Autoplay // @namespace https://github.com/johnnyawesome -// @version 1.0.5 +// @version 1.0.6 // @description Take over the world! :) // @author JohnnyAwesome // @match http://www.youtube.com/* @@ -14,23 +14,17 @@ // @noframes // ==/UserScript== -(function() { - 'use strict'; +'use strict'; - setInterval(turnAutoplayOff, 5000); +setInterval(turnAutoplayOff, 10000); - function turnAutoplayOff(){ +function turnAutoplayOff(){ - //if Autplay is turned on.... - if(document.querySelector(".yt-uix-checkbox-on-off input[type='checkbox']:checked + label")){ + console.log("Status of Autoplay:", document.getElementById("toggle").getAttribute("aria-pressed")); - //...turn it off. - document.getElementById('autoplay-checkbox').click(); - } - - if(document.getElementById("improved-toggle").getAttribute("aria-pressed") == 'true'){ - document.getElementById("improved-toggle").click(); - } + if(document.getElementById("toggle").getAttribute("aria-pressed") == 'true'){ + console.log("Autoplay is turned on. Turning it off.") + document.getElementById("toggle").click(); } -})(); +}