]> git.parisson.com Git - pdf.js.git/commitdiff
Workaround for FF bug
authorArtur Adib <arturadib@gmail.com>
Tue, 24 Jan 2012 15:39:57 +0000 (10:39 -0500)
committerArtur Adib <arturadib@gmail.com>
Tue, 24 Jan 2012 15:39:57 +0000 (10:39 -0500)
web/viewer.js

index 87f1c4b379709834581cad5b9461a2b2cd7292aa..11c0769a35229dfe0acc10c909e839a987f9ec06 100644 (file)
@@ -62,13 +62,16 @@ var RenderingQueue = (function RenderingQueueClosure() {
 })();
 
 // Settings Manager - This is a utility for saving settings
-// First we see if localStorage is available, FF bug #495747
+// First we see if localStorage is available
 // If not, we use FUEL in FF
 var Settings = (function SettingsClosure() {
   var isLocalStorageEnabled = (function localStorageEnabledTest() {
     // Feature test as per http://diveintohtml5.info/storage.html
+    // The additional localStorage call is to get around a FF quirk, see
+    // bug #495747 in bugzilla
     try {
-      return 'localStorage' in window && window['localStorage'] !== null;
+      return 'localStorage' in window && window['localStorage'] !== null &&
+          localStorage;
     } catch (e) {
       return false;
     }