Created
October 26, 2023 18:38
-
-
Save FoC-/3b5fd6bb0cf8ac308369d31162dbf0d2 to your computer and use it in GitHub Desktop.
This is jailbrake script for YouTube + ADblocker. Create bookmarklet from this script, and You can continue use ADblocker with YouTube.
This file contains hidden or 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
| javascript: ((document, tagName, target) => { | |
| var iframeScript = document.createElement(tagName); | |
| iframeScript.src = "https://www.youtube.com/iframe_api"; | |
| var contentScript = document.createElement(tagName); | |
| var text = document.createTextNode(`function onYouTubeIframeAPIReady() { | |
| new YT.Player(${target}, { videoId: new URLSearchParams(window.location.search).get("v") }); | |
| }`); | |
| contentScript.appendChild(text); | |
| var firstScriptTag = document.getElementsByTagName(tagName)[0]; | |
| firstScriptTag.parentNode.insertBefore(contentScript, firstScriptTag); | |
| firstScriptTag.parentNode.insertBefore(iframeScript, contentScript); | |
| })(document, "script", "player"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment