PDF/PPT/TIF viewer with Google docs

By Koonies Last update Oct 24, 2009 — Installed 20,206 times.

great but does not work on Oracle site

in
Subscribe to great but does not work on Oracle site 4 posts, 3 voices



JimboJones User
FirefoxWindows

The script works great, I tested it on quite a lot of sites, I have issues with Oracle.com site, the script does not convert any documents from this site http://www.oracle.com/pls/db112/homepage

 
2x Scriptwright
FirefoxWindows

You can use encoreURIComponent (at least it seems to work for the oracle.com).
Just don't forget to convert _all_ .pdf links to Google Docs links.
Something like this:

(function(){
if (location.href.indexOf("
var l = document.getElementsByTagName("a");
var i = l.length;
while (i--) {
if (l[i].href.match(/\.(pdf|ppt|tif)$/)) {
l[i].href = '
http://docs.google.com/viewer?url=' + encodeURIComponent(l[i].href);
}
}
}
})();

 
Koonies Script's Author
ChromeWindows

Current version doesn't convert a URL intentionally if the URL include '?'. If you want to do soon, please change the following part.

* current code
if (l[i].href.match(/^[^?]+.(pdf|ppt|tif)$/)) {

* changed code
if (l[i].href.match(/.(pdf|ppt|tif)$/)) {

But it is wrong in the case of the following.

[Before]
http://docs.google.com/viewer?url=http://igor.chudov.com/diveintogreasemonkey.pdf

[After]
http://docs.google.com/viewer?http://docs.google.com/viewer?url=http://igor.chudov.com/diveintogreasemonkey.pdf

Probably I will upload improved version a few days later.

 
Koonies Script's Author
ChromeWindows

I've uploaded the new version.

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel