// ==UserScript== // @name Substack Is Wack // @namespace https://github.com/boogah/userscripts // @version 2026.04.15 // @description Automatically redirects Substack articles (including custom domains) to their archive.is analog. // @author boogah // @match https://*.substack.com/p/* // @match http://*/* // @match https://*/* // @exclude https://archive.today/* // @exclude https://archive.fo/* // @exclude https://archive.is/* // @exclude https://archive.li/* // @exclude https://archive.md/* // @exclude https://archive.ph/* // @exclude https://archive.vn/* // @license GPL-2.0 // @grant none // @run-at document-idle // ==/UserScript== (function () { 'use strict'; var host = window.location.hostname; if (host.endsWith('.substack.com')) { redirect(); return; } if (isSubstack()) { redirect(); } function isSubstack() { if (document.querySelector('meta[name="generator"][content="Substack"]')) return true; if (document.querySelector('link[href*="substackcdn.com"]')) return true; if (document.querySelector('script[src*="substack.com"], script[src*="substackcdn.com"]')) return true; if (document.querySelector('[data-component-name="AppFrame"]')) return true; var rss = document.querySelector('link[type="application/rss+xml"]'); if (rss && /substack\.com/.test(rss.getAttribute('href'))) return true; return false; } function redirect() { window.location.replace( 'https://archive.is/?run=1&url=' + encodeURIComponent(window.location.href) ); } })();