ad free youtube grid

hides new format top level youtube ads

当前为 2020-07-16 提交的版本,查看 最新版本

  1. // ==UserScript==
  2.  
  3. // @name ad free youtube grid
  4. // @namespace twitter_kboudy
  5. // @description hides new format top level youtube ads
  6. // @include https://youtube.com/*
  7. // @include https://youtube.com
  8. // @version 1.0
  9. // @run-at document-start
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. function hideTopLevelAdContent(){
  14. const ads = document.getElementsByTagName("ytd-display-ad-renderer");
  15. if (ads)
  16. {
  17. for (const a of ads)
  18. {
  19. a.style.display="none";
  20. }
  21. }
  22. }
  23.  
  24. hideTopLevelAdContent();
  25. setInterval(function(){
  26. hideTopLevelAdContent();
  27. },1000);