Telokis

Youtube auto close popup

Oct 21st, 2018
195,878
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         Youtube auto close popup
  3. // @version      0.2
  4. // @description  Will auto close the Youtube popup prompting you to continue playing
  5. // @author       Telokis
  6. // @include      /^https?://(?:www\.)?youtube\.com/.*/
  7. // @downloadURL  https://pastebin.com/raw/w2ecSspS
  8. // @grant        none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12.   "use strict";
  13.  
  14.   setInterval(function() {
  15.     var elem = document
  16.       .querySelector(
  17.         ".style-scope.ytd-popup-container>yt-confirm-dialog-renderer .buttons.style-scope.yt-confirm-dialog-renderer>yt-button-renderer#confirm-button"
  18.       );
  19.    
  20.     if (elem) {
  21.       elem.click();
  22.     }
  23.   }, 500);
  24. })();
Advertisement
Add Comment
Please, Sign In to add comment