Yahoo mail remove adblock modal

Keeps checking for the modal then removes it, then stops checking

  1. // ==UserScript==
  2. // @name Yahoo mail remove adblock modal
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Keeps checking for the modal then removes it, then stops checking
  6. // @author You
  7. // @match https://mail.yahoo.com/*
  8. // @grant none
  9. // ==/UserScript==
  10. // jshint esversion:6
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. var myInterval = setInterval(function(){
  16. //var myobj = document.getElementById("modal-outer");
  17. //if(myobj) myobj.remove();
  18. //alert("I'm here");
  19. var modalOuter = document.querySelector('#modal-outer');
  20. var modalContent = document.querySelectorAll(`div[data-test-id='modal-content']`)[0];
  21.  
  22. if(modalContent && modalOuter) {
  23. modalContent.remove();
  24. modalOuter.remove();
  25. console.log("Pests removed;");
  26. clearInterval(myInterval);
  27. }
  28. //else console.log("Round we go");
  29. //var modalCue = document.querySelectorAll(`[data-test-id='adblockDelayDismissCue']`);
  30. //if(modalCue) modalCue.remove();
  31. }, 100);
  32. /* setTimeout(function(){
  33.  
  34. }, 500); */
  35.  
  36.  
  37.  
  38.  
  39.  
  40. })();