From d864bf834eaeebb16c5039f3dd7229d7f25237be Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 17 Sep 2009 20:00:33 +0000 Subject: [PATCH] Fix forcing of certain (text) file extensions to open externally --- chrome/content/zotero/xpcom/mime.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/chrome/content/zotero/xpcom/mime.js b/chrome/content/zotero/xpcom/mime.js index 583b32222..f060d2447 100644 --- a/chrome/content/zotero/xpcom/mime.js +++ b/chrome/content/zotero/xpcom/mime.js @@ -93,7 +93,7 @@ Zotero.MIME = new function(){ * Check if file extension should be forced to open externally */ function isExternalTextExtension(ext){ - return typeof _externalTextExtensions['ext'] != 'undefined'; + return typeof _externalTextExtensions[ext] != 'undefined'; } @@ -312,7 +312,7 @@ Zotero.MIME = new function(){ * Determine if a MIME type can be handled natively * or if it needs to be passed off to a plugin or external helper app * - * ext is an optional extension hint (only needed for text/plain files + * ext is an optional extension hint (only needed for text files * that should be forced to open externally) * * Note: it certainly seems there should be a more native way of doing this @@ -322,9 +322,9 @@ Zotero.MIME = new function(){ * do what we need */ function hasNativeHandler(mimeType, ext) { - if (mimeType=='text/plain'){ + if (mimeType.match(/^text\//)) { if (isExternalTextExtension(ext)){ - Zotero.debug('text/plain file has extension that should be handled externally'); + Zotero.debug('text file has extension that should be handled externally'); return false; } return true;