YouTube Anti-AdBlock Bypass via YouTube Enhancer

A simple method of bypassing YouTube's AdBlock Detection using Enhancer for YouTube's "Remove Ads" button. Does not require the use of any external website like similar tools do :)

当前为 2023-10-21 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name YouTube Anti-AdBlock Bypass via YouTube Enhancer
  3. // @namespace https://e-z.bio/yaw
  4. // @icon https://www.gstatic.com/youtube/img/branding/favicon/favicon_192x192.png
  5. // @version 1.3.1
  6. // @description A simple method of bypassing YouTube's AdBlock Detection using Enhancer for YouTube's "Remove Ads" button. Does not require the use of any external website like similar tools do :)
  7. // @author Yaw
  8. // @match https://www.youtube.com/*
  9. // @run-at document-start
  10. // @license MIT
  11. // @grant none
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16.  
  17. var searchInterval = 800
  18. var failCounter = 0
  19. var masterSwitch = true
  20.  
  21. function removeAds() {
  22. const currentURL = window.location.href;
  23. if (masterSwitch) {
  24. if (/https:\/\/www\.youtube\.com\/watch\?.*/.test(currentURL)) { // match url pattern - credits: Zion
  25. const button = document.getElementById("efyt-not-interested");
  26. const adShowing = [...document.querySelectorAll('.ad-showing')][0];
  27. if (adShowing) {
  28. if (button) {
  29. button.click();
  30. console.log("Button found and clicked.")
  31. failCounter = 0
  32. }
  33. else {
  34. console.log("Failed to find button. Retrying in ", searchInterval, " ms")
  35. failCounter = failCounter + 1
  36. }
  37. if (failCounter > 10) {
  38. var buttonNotFound = window.confirm("Failed to find the button more than 10 times. Please make sure that Enhancer for YouTube is installed.\n\nPress 'OK' to redirect to the installation page.\nPress 'Cancel' to disable the Bypasser for this session.");
  39. if (buttonNotFound) {
  40. window.open("https://chrome.google.com/webstore/detail/enhancer-for-youtube/ponfpcnoihfmfllpaingbgckeeldkhle");
  41. failCounter = 0
  42. } else {
  43. masterSwitch = false
  44. }
  45. }
  46. }
  47. }
  48. }
  49. }
  50.  
  51. setInterval(removeAds, searchInterval);
  52. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址