Greasy Fork is available in English.

Stackoverflow.com redirect to archive.org

Auto redirect Stackoverflow to archive.org when super ultra low user experience Cloudflare captcha detected.

Fra og med 11.10.2024. Se den nyeste version.

  1. // ==UserScript==
  2. // @name Stackoverflow.com redirect to archive.org
  3. // @namespace https://wsl.moe/
  4. // @version 2024-10-11
  5. // @description Auto redirect Stackoverflow to archive.org when super ultra low user experience Cloudflare captcha detected.
  6. // @license WTFPL
  7. // @author You
  8. // @match https://*.stackexchange.com/*
  9. // @match https://*.stackoverflow.com/*
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. let executeCount = 0;
  16. let intervalId = 0;
  17.  
  18. intervalId = setInterval(() => {
  19. if (executeCount > 10) {
  20. clearInterval(intervalId);
  21. }
  22. if (
  23. document.body.innerText.indexOf('Ray ID: ') !== -1 &&
  24. document.getElementsByTagName('a')[0].href.indexOf('utm_source=challenge') !== -1 &&
  25. document.body.innerHTML.indexOf('/cdn-cgi/challenge-platform/') !== -1
  26. ) {
  27. const origUrl = location.href;
  28. location.href = 'https://web.archive.org/web/' + origUrl;
  29. }
  30. executeCount += 1;
  31. }, 2000);
  32. })();