// ==UserScript==
// @name           gPDF
// @version        1.2
// @author         ArpitNext
// @namespace      http://blog.arpitnext.com/
// @description    Scans web pages for pdf links and sets them to open with Google PDF viewer.
// @include        *
// @exclude        http://docs.google.com/*
// ==/UserScript==

(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"){
		if(dl[i].href.substr(-4)==".pdf"){
			dl[i].href="http://docs.google.com/viewer?url="+encodeURI(dl[i].href);
		}
           }    
         }                
	}
})();