Prevents you from having to sign in to view age restricted videos on YouTube
当前为
// ==UserScript==
// @name Youtube Age Confirmation Bypass
// @namespace kneels
// @description Prevents you from having to sign in to view age restricted videos on YouTube
// @include https://www.youtube.*/watch*
// @include http://*.youtube.*/watch*
// @include https://*.youtube.*/watch*
// @match http://*.youtube.*/watch*
// @match https://*.youtube.*/watch*
// @version 1.3
// @grant none
// ==/UserScript==
var el = document.getElementById('unavailable-submessage');
if(el.hasChildNodes()) {
var embedString = "<iframe width=\"100%\" height=\"100%\" src='" +
getEmbedUrl() +
"?autoplay=1' frameborder=\"0\" allowfullscreen></iframe>";
document.getElementById('player-unavailable').innerHTML = embedString;
}
function getEmbedUrl()
{
var urlStr = window.location.href.replace('watch?v=', 'embed/');
var junk = urlStr.indexOf("&");
if(junk != -1) {
urlStr = urlStr.substr(0, junk);
}
return urlStr;
};