Kill autoplay on YouTube channel and user pages
< Feedback on Kill YouTube Channel Video Autoplay
// @grant none
// downloadURL //greasyfork.org/scripts/483523/
// ==/UserScript==
(function () {
'use strict';
const consoleOutput = true
setInterval(() => {
const storageItem = JSON.parse(window.sessionStorage.getItem('yt-player-autonavstate'))
const autoplayButton = document.querySelector('button[data-tooltip-target-id="ytp-autonav-toggle-button"]')
if (storageItem.data === '2' && autoplayButton.querySelector('.ytp-autonav-toggle-button[aria-checked="true"]')) {
if (consoleOutput) console.log(`${new Date().toLocaleTimeString()}: 🙄 YouTube попробовал еще раз активировать автозапуск!`)
setTimeout(() => {
autoplayButton.click()
if (consoleOutput) console.log(`${new Date().toLocaleTimeString()}: It's disabled again.`)
}, 1000)
}
}, 2000)
})();
The trouble with all such scripts is that it requires a reboot to enable
In general, it does not work