PDF/PPT/TIF viewer with Google docs

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

If you're interested, Google Docs now supports .doc, .pps and .docx files as well.

in
Subscribe to If you're interested, Google Docs now supports .doc, .pps and .docx files as well. 2 posts, 2 voices



ftvs Scriptwright
OperaWindows

// ==UserScript==
// @name           PDF/PPT/TIF viewer with Google docs
// @namespace      http://d.hatena.ne.jp/Koonies/
// @include        http://*
// @exclude        http://docs.google.com/*
// @version        1.2
// ==/UserScript==

(function(){
	if (location.href.indexOf("http://docs.google.com/") == -1) {
		var l = document.getElementsByTagName("a");
		var i = l.length; 
		while (i--) {
			if (l[i].href.match(/^https*:([^?]+|[^:]+)\.(pdf|ppt|pps|tif|tiff|doc|docx)$/i)) {
				var ico = document.createElement("img");
				ico.src = "http://docs.google.com/favicon.ico";
				l[i].parentNode.insertBefore(ico, l[i]);
				l[i].href = 'http://docs.google.com/viewer?url=' + l[i].href;
			}
		}
	}
})();

がんばって... or something.

 
dalboz User
FirefoxMacintosh

yes i have edited my version to add the doc/docx extensions to the regex. should be updated in original 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