// ==UserScript== // @name Youtube AdBlock ban bypass // @namespace http://tampermonkey.net/ // @version 0.1 // @description Delete the player and creates and iframe of the video in an embed // @author Obelous // @match https://www.youtube.com/* // @match https://www.youtube-cocookie.com/* // @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com // @grant none // @license MIT // @downloadURL none // ==/UserScript== let currentPageUrl = window.location.href; window.addEventListener('beforeunload', function () { currentPageUrl = window.location.href; }); document.addEventListener('yt-navigate-finish', function () { const newUrl = window.location.href; if (newUrl !== currentPageUrl) { location.reload(); } }); function splitUrl(str) { return str.split('=')[1]; } function run() { console.log("Loaded"); const block = document.querySelector('.yt-playability-error-supported-renderers'); block.parentNode.removeChild(block); const url = "https://youtube.com/embed/" + splitUrl(window.location.href); const oldplayer = document.getElementById("error-screen"); const player = document.createElement('iframe'); player.setAttribute('src', url); player.style = "height:100%;width:100%;border-radius:12px;"; player.id = "youtube-iframe"; oldplayer.appendChild(player); console.log('Finished'); } (function() { 'use strict'; setTimeout(run, 500); })();