marcinsu / Youtube Age Confirmation

// ==UserScript==
// @name        Youtube Age Confirmation
// @namespace   https://openuserjs.org/users/marcinsu
// @updateURL   https://openuserjs.org/meta/marcinsu/Youtube_Age_Confirmation.meta.js
// @author      marcinsu
// @version     1.01
// @domain      youtube.com
// @domain      www.youtube.com
// @include     *youtube.com/watch*
// @grant       none
// ==/UserScript==

var content = document.getElementById('watch7-player-age-gate-content');
if (content !== null) {
  var form = content.getElementsByTagName('form');
  if (form !== null && form.length == 1) {
    form[0].submit();
  }
}