From 9b76f4b5b8162fe9e309f204c563455f23f96d7c Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Tue, 14 Feb 2012 23:01:44 -0500 Subject: [PATCH] Hack to open PDFs in pdf.js when available --- chrome/content/zotero/xpcom/mime.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/chrome/content/zotero/xpcom/mime.js b/chrome/content/zotero/xpcom/mime.js index 87866fe09e..7a64e5f24c 100644 --- a/chrome/content/zotero/xpcom/mime.js +++ b/chrome/content/zotero/xpcom/mime.js @@ -355,6 +355,12 @@ Zotero.MIME = new function(){ return isNative; } + if(mimeType === "application/pdf" + && "@mozilla.org/streamconv;1?from=application/pdf&to=*/*" in Components.classes) { + // PDF can be handled internally if pdf.js is installed + return true; + } + // Is there a better way to get to navigator? var types = Components.classes["@mozilla.org/appshell/appShellService;1"] .getService(Components.interfaces.nsIAppShellService)