XUL localStorage fall-thru
authorBill Erickson <berick@esilibrary.com>
Mon, 28 Jan 2013 15:37:22 +0000 (10:37 -0500)
committerBill Erickson <berick@esilibrary.com>
Mon, 28 Jan 2013 15:37:22 +0000 (10:37 -0500)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/web/js/dojo/openils/XUL.js

index 1b6bbf1..0254f7f 100644 (file)
@@ -169,6 +169,11 @@ if(!dojo._hasResource["openils.XUL"]) {
     // localStorage is not directly accessible within oils://
     // http://fartersoft.com/blog/2011/03/07/using-localstorage-in-firefox-extensions-for-persistent-data-storage/
     openils.XUL.localStorage = function() {
+
+        // in browser mode, use the standard localStorage interface
+        if (!openils.XUL.isXUL()) 
+            return window.localStorage;
+
         var url = location.protocol + '//' + location.hostname;
         var ios = Components.classes["@mozilla.org/network/io-service;1"]
                   .getService(Components.interfaces.nsIIOService);