Fix the "Ad blockers violate YouTube's Terms of Service" Error
< Feedback on Youtube AdBlock ban bypass
You also have to change the splitUrl()
function to return like this instead:
function splitUrl(str) {
return str.split('=')[1].split('&')[0];
}
This is because if you click a video from your notifications, an ID is attached to the end of the URL (e.g. &lc=Ugwz7P5LSoxcCCQnTGh4AaABAg
) and this breaks the embedded version of the youtube player - the video will just fail to load. The same goes for things like timestamp tags (e.g. &t=4m00s
) - this also breaks the embedded player. Basically any and all extraneous data in the video URL has to be removed first.
Also, this line is incorrect:
player.setAttribute('allowfullscreen', true);
Change it to be like this, to extend the support to all currently existing browsers:
player.setAttribute('allowfullscreen', "allowfullscreen");
player.setAttribute('mozallowfullscreen', "mozallowfullscreen");
player.setAttribute('msallowfullscreen', "msallowfullscreen");
player.setAttribute('oallowfullscreen', "oallowfullscreen");
player.setAttribute('webkitallowfullscreen', "webkitallowfullscreen");
player.setAttribute('webkitallowfullscreen', "webkitallowfullscreen");
Otherwise, the fix is appreciated. Keep fighting the good fight. :)
Hi, at 03:30 on 21/10/2023 French time and date, I ran into the same problem, I came across your script by chance :3, I fixed the problem of fullscreen and autoplay.
Thanks again for the script ^^