TF Youtube

YouTube's popups? They don't bother you, and they definitely don't bother me.

  1. // ==UserScript==
  2. // @name TF Youtube
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0.0
  5. // @description YouTube's popups? They don't bother you, and they definitely don't bother me.
  6. // @author koisi._.704
  7. // @match *://www.youtube.com/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
  9. // @license MIT
  10. // @grant none
  11. // ==/UserScript==
  12. function we_need_a_cool_name_for_the_function() {
  13. const dialogElement = document.querySelector('tp-yt-paper-dialog[style-target="host"][role="dialog"]');
  14. const videoElement = document.querySelector('video.video-stream.html5-main-video');
  15.  
  16. if (dialogElement) {
  17. dialogElement.remove();
  18. console.log("I removed one popup for you.");
  19. if (videoElement && videoElement.paused) {
  20. videoElement.play();
  21. console.log("playing.");
  22. }
  23. }
  24. }
  25.  
  26. setInterval(we_need_a_cool_name_for_the_function, 1000);