Stackoverflow.com redirect to archive.org

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

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

  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. })();