Created
June 14, 2023 17:53
-
-
Save fortserious/ca2e905bd08843a976be360ab820e96f to your computer and use it in GitHub Desktop.
google cached link
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
// ==UserScript== | |
// @name google cache fixer | |
// @namespace www.rossdoran.com | |
// @version 0.1 | |
// @description adds a "Cached link" URL next to each google search result | |
// @match https://www.google.com/search?q=* | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js | |
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js | |
// @copyright ross doran 2023 | |
// ==/UserScript== | |
OnLoad(".yuRUbf a:not('.cachelink')", function callback(jNode) { | |
var newNode = document.createElement('a'); | |
newNode.setAttribute('href', 'http://webcache.googleusercontent.com/search?q=cache:' + jNode.attr('href')); | |
newNode.setAttribute('class','cachelink'); | |
newNode.setAttribute('style','padding-left: 6px'); | |
newNode.innerHTML = "Cached link"; | |
jNode.parent().append(newNode); | |
}); | |
function OnLoad(selector, callback) | |
{ | |
waitForKeyElements(selector, callback); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment