rename file and add updateurl

This commit is contained in:
2021-02-04 23:15:28 -05:00
parent a813612cd2
commit 32d64bf76b
2 changed files with 3 additions and 1 deletions

View File

@ -0,0 +1,26 @@
// ==UserScript==
// @name Turn off Youtube Autoplay
// @namespace https://bubbletea.dev/
// @version 1.0
// @description Disables Youtube recommended videos from automatically playing
// @author shibao
// @include https://www.youtube.com/watch*
// @downloadURL https://gitea.bubbletea.dev/bubbletea.dev/disable-youtube-autoplay/raw/branch/master/disable-youtube-autoplay.user.js
// @updateURL https://gitea.bubbletea.dev/bubbletea.dev/disable-youtube-autoplay/raw/branch/master/disable-youtube-autoplay.user.js
// @grant none
// ==/UserScript==
function disableAutoplay() {
var e = document.querySelector('button.ytp-button[data-tooltip-target-id="ytp-autonav-toggle-button"]');
if (e == null) {
console.error('Youtube checkbox could not be found!');
} else {
var isChecked = document.querySelector('.ytp-autonav-toggle-button').getAttribute('aria-checked') == "true";
if (isChecked) e.click();
}
}
(function () {
'use strict';
document.onLoad = setTimeout(disableAutoplay, 1000);
}) ();