Google Cached Text

By Gleb Kozyrev Last update Dec 5, 2006 — Installed 7,875 times.

Not working anymore

in
Subscribe to Not working anymore 4 posts, 4 voices



mbarbier User

It looks like Google changed the format of the search results page URLs. I tried to update this script on my computer accordingly, but I can't seem to get it to work.

 
666f6f Scriptwright

It's working for me, but I think the "Included Pages" is a bit restrictive. For example if I do a search from Google France, the text link is missing. If I set the "Included Pages" to http://www.google.* seems to be OK.

 
jesus2099 Scriptwright
OperaWindows

Very good guess 666f6f!
Actually, I replaced the two initial includes by:

// @include       http://www.google.*/search*

I think it's just great this way.

 
CMC User
FirefoxWindows

Updated the code to work with recent changes on Google search result page. Currently for Firefox.

September 1, 2010

var allLinks, thisLink;

allLinks = document.evaluate(
    "//a[contains(@href,'/search%3Fq%3Dcache')]",
    document,
    null,
    XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
    null);
for (var i = 0; i < allLinks.snapshotLength; i++) 
{
    thisLink = allLinks.snapshotItem(i);
    var txt = document.createElement("a");
    txt.className = thisLink.className;
    
    start = thisLink.href.indexOf("cache:");
    start = start + 6;
    end = thisLink.href.indexOf("%2B");

    var newlink = thisLink.href.substring(start,end);


    txt.href = "http://webcache.googleusercontent.com/search?q=cache:" + newlink + "&hl=en&client=firefox-a&gl=my&strip=1";
    txt.insertBefore(document.createTextNode("Text"),null);
    thisLink.parentNode.insertBefore(txt, thisLink.nextSibling);
    thisLink.parentNode.insertBefore(document.createTextNode(" - "),txt);
}