-
-
Save tadwohlrapp/e7bac5a8f8fe4f8affc438553973fc38 to your computer and use it in GitHub Desktop.
Bookmarklet to open either the oldest or the newest available snapshot of the current page on the Internet Archive Wayback Machine (https://archive.org/)
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:(()=>{let u=location.href;if(u.match(/^https?:\/\//)||(u=loadTimeDataRaw?.reloadButton?.reloadUrl),null!==u&&""!==u){let o=`https://web.archive.org/web/19700101000000/${u}`,n=`https://web.archive.org/web/${new Date().toISOString().replaceAll(/\D/g,"").slice(0,-3)}/${u}`;confirm("Click »Cancel« to open the OLDEST available Snapshot.\nClick »OK« to open the NEWEST available snapshot.")?window.open(n,"_blank"):window.open(o,"_blank")}})(); |
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
| (() => { | |
| const href = location.href; | |
| if (!href.match(/^https?:\/\//)) { | |
| // error pages on chrome return location.href = 'chrome-error://chromewebdata/' | |
| href = loadTimeDataRaw?.reloadButton?.reloadUrl; | |
| } | |
| if (href !== null && href !== "") { | |
| const oldest = `https://web.archive.org/web/19700101000000/${href}`; | |
| const newest = `https://web.archive.org/web/${new Date().toISOString().replaceAll(/\D/g, "").slice(0, -3)}/${href}`; | |
| if (confirm("Click \xbbCancel\xab to open the OLDEST available Snapshot.\nClick \xbbOK\xab to open the NEWEST available snapshot.")) { | |
| window.open(newest, "_blank"); | |
| } | |
| else { | |
| window.open(oldest, "_blank"); | |
| } | |
| } | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment