Forked from cutiepoka/gist:a9347c68bfcf29060926a8af46bb1701
Created
October 23, 2023 11:13
-
-
Save prochor666/5be1b74fba999efa624ad37d583bea01 to your computer and use it in GitHub Desktop.
Youtube allow ads popup blocker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name youtube popup killer | |
// @namespace http://tampermonkey.net/ | |
// @version 0.3 | |
// @description try to take over the world! | |
// @author Selbereth | |
// @match https://*.youtube.com/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com | |
// @grant none | |
// ==/UserScript== | |
(function () { | |
window.debug = true; | |
if (debug) console.log("started"); | |
setInterval(() => { | |
if (!!popupFind()) { | |
if (debug) console.log("remove popup"); | |
const popup = popupFind() | |
console.log(popup) | |
popup.parentNode.removeChild(popup) | |
if (debug) console.log("resume video"); | |
//pauseFind().click() | |
if (debug) console.log("done "); | |
} | |
}, 1000); | |
})(); | |
function popupFind() { | |
return document.querySelector("body > ytd-app > ytd-popup-container"); | |
} | |
function pauseFind(){ | |
return document.querySelector("#movie_player > div.ytp-chrome-bottom > div.ytp-chrome-controls > div.ytp-left-controls > button"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment