Remove autoplay from video suggestions on youtube
目前為
// ==UserScript==
// @name Remove Youtube Autoplay
// @namespace https://gitlab.com/helq
// @description Remove autoplay from video suggestions on youtube
// @include http://www.youtube.com/*
// @include https://www.youtube.com/*
// @version 0.1.0
// @grant none
// @author helq
// @license CC0
// ==/UserScript==
// Script based from:
// http://greasyfork.org/scripts/7893 by @wxc (https://greasyfork.org/en/users/8868-wxc)
function f() {
"use strict";
try {
//console.log("Detecting autoplay");
let node = document.getElementById('improved-toggle');
if (node.hasAttribute('active')) {
console.log("Autoplay on. Turning it off");
node.click();
document.body.removeEventListener('DOMSubtreeModified', f, false);
}
}
catch (e) {}
}
f();
document.body.addEventListener('DOMSubtreeModified', f, false);
setTimeout(f, 400);