msdos622@lemmy.world to Lemmy.World Announcements@lemmy.worldEnglish · 2 years agoMust resistlemmy.worldimagemessage-square57fedilinkarrow-up1465arrow-down16
arrow-up1459arrow-down1imageMust resistlemmy.worldmsdos622@lemmy.world to Lemmy.World Announcements@lemmy.worldEnglish · 2 years agomessage-square57fedilink
minus-squarememchr@lemmy.worldlinkfedilinkEnglisharrow-up5·2 years ago// ==UserScript== // @name archive.org link // @include *://*.google*/search* // @include *://* // @exclude *://*.archive.org* // @exclude *://archive.org* // @grant none // @version 1.0 // @author memchr // @description 6/15/2023, 6:57:32 AM // ==/UserScript== function get_archive_href(href) { return "https://web.archive.org/web/" + href.replace(/^https?:\/\/www\.reddit\.com/, "https://old.reddit.com") } if (window.location.hostname.match(/^(\w*\.)?google.*$/)) { // google const results = document.querySelectorAll('div.yuRUbf > a'); results.forEach(e => { let href = e.getAttribute('href'); href = get_archive_href(href); let archive_link = document.createElement('a'); archive_link.href = href; archive_link.textContent = "archive"; archive_link.style.marginLeft = "10px"; e.insertAdjacentElement("afterend", archive_link); }) } else if (!window.location.hostname.match(/(localhost$|^(127|192|10)\.)/)) { const href = get_archive_href(location.href); document.addEventListener('keydown', function(event) { if (event.ctrlKey && event.altKey && event.key === 'a') { window.location.href = href; } }); } press shift+ctrl+A or click on archive if you use google.
minus-squaremsdos622@lemmy.worldOPlinkfedilinkEnglisharrow-up4·2 years agoNice try. I’ve seen TV shows. This is to get into the C.I.A. workframe mastercode :) Seriously tho, where do I put this?
minus-squarememchr@lemmy.worldlinkfedilinkEnglisharrow-up3·2 years agouser script manager like this one
minus-squaresnarfvsmaximvs@lemmy.worldlinkfedilinkEnglisharrow-up3·2 years agoFor anyone wondering, this is a tampermonkey/violentmonkey script.
// ==UserScript== // @name archive.org link // @include *://*.google*/search* // @include *://* // @exclude *://*.archive.org* // @exclude *://archive.org* // @grant none // @version 1.0 // @author memchr // @description 6/15/2023, 6:57:32 AM // ==/UserScript== function get_archive_href(href) { return "https://web.archive.org/web/" + href.replace(/^https?:\/\/www\.reddit\.com/, "https://old.reddit.com") } if (window.location.hostname.match(/^(\w*\.)?google.*$/)) { // google const results = document.querySelectorAll('div.yuRUbf > a'); results.forEach(e => { let href = e.getAttribute('href'); href = get_archive_href(href); let archive_link = document.createElement('a'); archive_link.href = href; archive_link.textContent = "archive"; archive_link.style.marginLeft = "10px"; e.insertAdjacentElement("afterend", archive_link); }) } else if (!window.location.hostname.match(/(localhost$|^(127|192|10)\.)/)) { const href = get_archive_href(location.href); document.addEventListener('keydown', function(event) { if (event.ctrlKey && event.altKey && event.key === 'a') { window.location.href = href; } }); }
press
shift
+ctrl
+A
or click onarchive
if you use google.Nice try. I’ve seen TV shows. This is to get into the C.I.A. workframe mastercode :)
Seriously tho, where do I put this?
user script manager like this one
For anyone wondering, this is a tampermonkey/violentmonkey script.