Skip to content

Instantly share code, notes, and snippets.

@jpluimers
Created October 27, 2025 18:50
Show Gist options
  • Save jpluimers/39fda580caca6235cec295377fcd20b0 to your computer and use it in GitHub Desktop.
Save jpluimers/39fda580caca6235cec295377fcd20b0 to your computer and use it in GitHub Desktop.
Bookmarklet for Archive.is to navigate to the canonical link with the "redirected from" instead of "saved from"
javascript: (function() {
canonical = document.querySelector('link[rel="canonical"]')?.href;
anchor = document.createElement("a");
anchor.href = canonical;
pathname = anchor.pathname;
separator = "/";
splitPathname = pathname.split(separator);
timestamp = splitPathname[1];
redirectFrom = document.querySelectorAll('input[readonly]')[0]?.value;
anchor.pathname = "";
anchor.search = "";
anchor.hash = "";
href = anchor.href;
hrefTemplate = `${href}${timestamp}${separator}${redirectFrom}`;
anchor.href = hrefTemplate;
location = anchor.href;
})();
javascript:(function(){canonical = document.querySelector('link[rel="canonical"]')?.href; anchor = document.createElement("a"); anchor.href = canonical; pathname = anchor.pathname; separator = "/"; splitPathname = pathname.split(separator); timestamp = splitPathname[1]; redirectFrom = document.querySelectorAll('input[readonly]')[0]?.value; anchor.pathname = ""; anchor.search = ""; anchor.hash = ""; href = anchor.href; hrefTemplate = `${href}${timestamp}${separator}${redirectFrom}`; anchor.href = hrefTemplate; location = anchor.href;})();
javascript: (function() {
canonical = document.querySelector('link[rel="canonical"]')?.href;
anchor = document.createElement("a");
anchor.href = canonical;
pathname = anchor.pathname;
separator = "/";
splitPathname = pathname.split(separator);
timestamp = splitPathname[1];
redirectFrom = document.querySelectorAll('input[readonly]')[0]?.value;
anchor.pathname = "";
anchor.search = "";
anchor.fragment = "";
hrefLeftParts = [anchor.href, timestamp];
hrefLeft = hrefLeftParts.join("");
hrefFullParts = [hrefLeft, redirectFrom];
href = hrefFullParts.join(separator);
location = href;
})();
javascript:(function(){canonical = document.querySelector('link[rel="canonical"]')?.href; anchor = document.createElement("a"); anchor.href = canonical; pathname = anchor.pathname; separator = "/"; splitPathname = pathname.split(separator); timestamp = splitPathname[1]; redirectFrom = document.querySelectorAll('input[readonly]')[0]?.value; anchor.pathname = ""; anchor.search = ""; anchor.fragment = ""; hrefLeftParts = [anchor.href, timestamp]; hrefLeft = hrefLeftParts.join(""); hrefFullParts = [hrefLeft, redirectFrom]; href = hrefFullParts.join(separator); location = href;})();