Youtube Age Confirmation Bypass

Prevents you from having to sign in to view age restricted videos on YouTube

Versione datata 01/08/2014. Vedi la nuova versione l'ultima versione.

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

You will need to install an extension such as Tampermonkey to install this script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==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.com/*
// @include     http://*.youtube.com/*
// @include     https://*.youtube.com/*
// @match       http://*.youtube.com/*
// @match       https://*.youtube.com/*
// @exclude     http://apiblog.youtube.com/*
// @exclude     https://apiblog.youtube.com/*
// @version     1.1
// @grant       none
// ==/UserScript==

var message = document.getElementById('player-mole-container').innerHTML;

if(message.search("Content Warning") != -1) {
   var embedString =   "<iframe width=\"100%\" height=\"100%\" src='" + 
                       getEmbedUrl() +  
                       "' 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;
};