Remove Youtube Ads (Working)

Removes all ads including video ads/recomended ads/poster ads/mid video ads.

目前為 2017-02-09 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name Remove Youtube Ads (Working)
  3. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js
  4. // @namespace http://tampermonkey.net/
  5. // @version 0.3
  6. // @description Removes all ads including video ads/recomended ads/poster ads/mid video ads.
  7. // @author Wrekt/Ethan
  8. // @match https://www.youtube.com/*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. var advideo = "false";
  13.  
  14. $("a").click(function(){
  15. location.reload();
  16. });
  17.  
  18. if ($(".ad-showing")[0]){
  19. advideo = "true";
  20. } else {
  21. advideo = "false";
  22. }
  23.  
  24. (function() {
  25. $("#header").remove();
  26. })();
  27.  
  28. setTimeout(function removead() {
  29. $("#watch7-sidebar-ads").remove();
  30. if (advideo == "true") {
  31. $(".video-stream").attr("src", "");
  32. }
  33. }, 500);
  34.  
  35. setTimeout(function removeads() {
  36. if (advideo == "true") {
  37. $(".video-stream").attr("src", "");
  38. }
  39. }, 800);
  40.  
  41. setTimeout(function removeadss() {
  42. $(".video-ads").remove();
  43. $("#pyv-watch-related-dest-url").remove();
  44. }, 6500);