Created
October 27, 2025 18:50
-
-
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"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | |
| })(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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;})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | |
| })(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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;})(); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tested with these links: