[Pkg-javascript-commits] [pdf.js] 15/109: Fixes supportsMozChunked for node.js

David Prévot taffit at moszumanska.debian.org
Fri Sep 25 03:04:13 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit 20b46aaf88b59d043a57d481973da1d97e035dbf
Author: Yury Delendik <ydelendik at mozilla.com>
Date:   Wed Aug 12 18:48:59 2015 -0500

    Fixes supportsMozChunked for node.js
---
 src/core/network.js | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/core/network.js b/src/core/network.js
index 5a28fee..8100303 100644
--- a/src/core/network.js
+++ b/src/core/network.js
@@ -73,18 +73,15 @@ var NetworkManager = (function NetworkManagerClosure() {
 
 //#if !(CHROME || FIREFOX || MOZCENTRAL)
   var supportsMozChunked = (function supportsMozChunkedClosure() {
-    var x = new XMLHttpRequest();
     try {
+      var x = new XMLHttpRequest();
       // Firefox 37- required .open() to be called before setting responseType.
       // https://bugzilla.mozilla.org/show_bug.cgi?id=707484
-      x.open('GET', 'https://example.com');
-    } catch (e) {
       // Even though the URL is not visited, .open() could fail if the URL is
       // blocked, e.g. via the connect-src CSP directive or the NoScript addon.
       // When this error occurs, this feature detection method will mistakenly
       // report that moz-chunked-arraybuffer is not supported in Firefox 37-.
-    }
-    try {
+      x.open('GET', 'https://example.com');
       x.responseType = 'moz-chunked-arraybuffer';
       return x.responseType === 'moz-chunked-arraybuffer';
     } catch (e) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list