Kill YouTube Channel Video Autoplay

Kill autoplay on YouTube channel and user pages

< Feedback on Kill YouTube Channel Video Autoplay

Question/comment

§
Posted: 2024-05-12
Edited: 2024-05-12

The trouble with all such scripts is that it requires a reboot to enable

In general, it does not work

§
Posted: 2024-05-12

// @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)

})();

Post reply

Sign in to post a reply.