clear-all-timeouts

Clear all timeouts after the page loads. Useful for sites that rely on timeouts to penalize AdBlock users (a common anti-AdBlock technique).

  1. // ==UserScript==
  2. // @name clear-all-timeouts
  3. // @namespace https://github.com/ahuanguchi
  4. // @version 1.1.1
  5. // @description Clear all timeouts after the page loads. Useful for sites that rely on timeouts to penalize AdBlock users (a common anti-AdBlock technique).
  6. // @author ahuanguchi
  7. // @match *://*/*
  8. // @grant none
  9. // @run-at document-start
  10. // ==/UserScript==
  11.  
  12. window.addEventListener("load", function () {
  13. var hostName = document.location.hostname;
  14. if (!document.getElementsByClassName("cf-browser-verification").length &&
  15. hostName !== "www.google.com" &&
  16. hostName !== "disqus.com") {
  17. var i;
  18. var latestId = setTimeout(function () {});
  19. for (i = 0; i < latestId; i += 1) {
  20. clearTimeout(i);
  21. }
  22. console.info("Cleared timeouts.");
  23. }
  24. });