Skip to content

Instantly share code, notes, and snippets.

@lassekongo83
Created September 15, 2020 16:37
Show Gist options
  • Save lassekongo83/8eac398eeda293f2ad12ac57b49be1a9 to your computer and use it in GitHub Desktop.
Save lassekongo83/8eac398eeda293f2ad12ac57b49be1a9 to your computer and use it in GitHub Desktop.
Auto-click the dismiss button on YouTube's annoying login modal and then automatically start the video.
// ==UserScript==
// @name Dismiss YouTube login modal
// @namespace https://www.youtube.com/
// @match https://www.youtube.com/*
// @grant none
// @version 0.1
// @description Auto-click the dismiss button on YouTube's annoying login modal
// ==/UserScript==
(function() {
"use strict";
function clickButton(selector){
let elm = document.querySelectorAll(selector)[0];
if (elm){ elm.click(); }
}
function tick(){
clickButton('#dismiss-button');
clickButton('.ytp-large-play-button');
}
setInterval(tick, 10);
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment