NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript==
// @name Unpause YouTube
// @namespace https://openuserjs.org/users/Sauvegarde
// @version 1.3.3
// @author Sauvegarde
// @description Autoclick the "video paused" popin when it appears
// @include https://*.youtube.com*
// @run-at document-idle
// @grant none
// @iconURL https://www.youtube.com/favicon.ico
// @updateURL https://openuserjs.org/meta/Sauvegarde/Unpause_YouTube.meta.js
// @downloadURL https://openuserjs.org/install/Sauvegarde/Unpause_YouTube.user.js
// @supportURL https://openuserjs.org/scripts/Sauvegarde/Unpause_YouTube/issues
// @copyright 2019, Sauvegarde (https://openuserjs.org/users/Sauvegarde)
// @license MIT
// ==/UserScript==
/* jshint esversion: 6 */
const TEXTS = ["Video paused", "Vidéo mise en pause"];
function click() {
document.querySelectorAll("yt-confirm-dialog-renderer").forEach(dialog => {
const dialogHidden = dialog.parentElement.style.display === "none";
if(!dialogHidden) {
dialog.querySelectorAll("yt-formatted-string").forEach(fs => {
TEXTS.forEach(TEXT => {
if(fs.innerHTML && fs.innerHTML.includes(TEXT)) {
dialog.querySelector("#confirm-button").click();
}
});
});
}
});
}
setInterval(click, 200);
/* Changelog:
** 1.3.3
* added run-at document-idle, we'll see if it work
* added the usual meta stuff
*/