From 5aa030161fffa74aaddd522e50ae078f84dc2c18 Mon Sep 17 00:00:00 2001 From: Jason Cosper Date: Wed, 14 Jun 2023 16:31:31 -0700 Subject: [PATCH] Create `substack-is-wack.js` --- substack-is-wack.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 substack-is-wack.js diff --git a/substack-is-wack.js b/substack-is-wack.js new file mode 100644 index 0000000..eb5fbb7 --- /dev/null +++ b/substack-is-wack.js @@ -0,0 +1,20 @@ +// ==UserScript== +// @name Substack Is Wack +// @namespace https://github.com/boogah/userscripts +// @version 2023.06.14 +// @description Automatically redirects substack.com articles to their archive.is analog. +// @author boogah +// @include https://*.substack.com/p/* +// @license GPL-2.0 +// @grant none +// ==/UserScript== + +window.addEventListener('load', function() { + // Check if we're on an archive.is page, if so stop execution + if (window.location.hostname === 'archive.is') { + return; + } + + var archiveURL = "https://archive.is/?run=1&url=" + encodeURIComponent(window.location.href); + window.location.href = archiveURL; +}, false);