Skip to content

Instantly share code, notes, and snippets.

@decklin
Created December 22, 2009 03:07
Show Gist options
  • Save decklin/261469 to your computer and use it in GitHub Desktop.
Save decklin/261469 to your computer and use it in GitHub Desktop.
(function () {
dl=document.links;
if(document.location.host!="docs.google.com"){
for(i=0;i<dl.length;++i){
if(dl[i].host!="docs.google.com"){
var ext = dl[i].href.substr(-4);
if(ext==".pdf"||ext==".ppt"){
dl[i].href="http://docs.google.com/viewer?url="+dl[i].href;
}
}
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment