Raw Source
Telokis / Youtube auto close popup

// ==UserScript==
// @name         Youtube auto close popup
// @version      0.2
// @description  Will auto close the Youtube popup prompting you to continue playing
// @author       Telokis
// @include      /^https?://(?:www\.)?youtube\.com/.*/
// @downloadURL  https://pastebin.com/raw/w2ecSspS
// @grant        none
// @license      MIT
// @copyright    2018, Telokis (https://openuserjs.org//users/Telokis)
// ==/UserScript==

(function () {
  "use strict";

  setInterval(function () {
    var elem = document
      .querySelector(
        ".style-scope.ytd-popup-container>yt-confirm-dialog-renderer .buttons.style-scope.yt-confirm-dialog-renderer>yt-button-renderer#confirm-button"
      );

    if (elem) {
      elem.click();
    }
  }, 500);
})();