From 0d02ab5098f3b3ae92ea710d27a43b2ad2132605 Mon Sep 17 00:00:00 2001 From: gigaherz Date: Mon, 31 Oct 2011 20:44:29 +0100 Subject: [PATCH 1/2] The extension should urlencode the pdf when sending it over to the viewer. --- extensions/firefox/components/pdfContentHandler.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/firefox/components/pdfContentHandler.js b/extensions/firefox/components/pdfContentHandler.js index a23461085..5f659bd9c 100644 --- a/extensions/firefox/components/pdfContentHandler.js +++ b/extensions/firefox/components/pdfContentHandler.js @@ -56,7 +56,8 @@ pdfContentHandler.prototype = { throw NS_ERROR_WONT_HANDLE_CONTENT; aRequest.cancel(Cr.NS_BINDING_ABORTED); - window.location = url.replace('%s', targetUrl); + aRequest.cancel(Cr.NS_BINDING_ABORTED); + window.location = url.replace('%s', encodeURIComponent(targetUrl)); }, classID: Components.ID('{2278dfd0-b75c-11e0-8257-1ba3d93c9f1a}'), From 2d8b0f767752f70568d35afa30c4f3d1b0205030 Mon Sep 17 00:00:00 2001 From: gigaherz Date: Mon, 31 Oct 2011 21:18:41 +0100 Subject: [PATCH 2/2] Properly fix the previous commit. --- extensions/firefox/components/pdfContentHandler.js | 1 - 1 file changed, 1 deletion(-) diff --git a/extensions/firefox/components/pdfContentHandler.js b/extensions/firefox/components/pdfContentHandler.js index 5f659bd9c..444db1c1f 100644 --- a/extensions/firefox/components/pdfContentHandler.js +++ b/extensions/firefox/components/pdfContentHandler.js @@ -55,7 +55,6 @@ pdfContentHandler.prototype = { if (targetUrl.indexOf('?pdfjs.action=download') >= 0) throw NS_ERROR_WONT_HANDLE_CONTENT; - aRequest.cancel(Cr.NS_BINDING_ABORTED); aRequest.cancel(Cr.NS_BINDING_ABORTED); window.location = url.replace('%s', encodeURIComponent(targetUrl)); },