From ce2828773b7dd543451d94040f5bc48988e65f53 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Sat, 20 Apr 2013 21:48:28 -0400 Subject: [PATCH] Fix saving PDFs open in pdf.js --- chrome/content/zotero/xpcom/attachments.js | 1 + chrome/content/zotero/zoteroPane.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/attachments.js b/chrome/content/zotero/xpcom/attachments.js index 113e2de61..32e641012 100644 --- a/chrome/content/zotero/xpcom/attachments.js +++ b/chrome/content/zotero/xpcom/attachments.js @@ -1487,6 +1487,7 @@ Zotero.Attachments = new function(){ */ this.isPDFJS = function(doc) { // pdf.js HACK + // This may no longer be necessary (as of Fx 23) if(doc.contentType === "text/html") { var win = doc.defaultView; if(win) { diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index 13591ae6c..d8268d8fc 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -3087,7 +3087,8 @@ var ZoteroPane = new function() if (itemType == 'temporaryPDFHack') { itemType = null; var isPDF = false; - if (doc.title.indexOf('application/pdf') != -1 || Zotero.Attachments.isPDFJS(doc)) { + if (doc.title.indexOf('application/pdf') != -1 || Zotero.Attachments.isPDFJS(doc) + || doc.contentType == 'application/pdf') { isPDF = true; } else {