diff --git a/lib/jquery.offline.js b/lib/jquery.offline.js index 8153671..541552a 100644 --- a/lib/jquery.offline.js +++ b/lib/jquery.offline.js @@ -36,7 +36,16 @@ // Allow the user to explicitly turn off localStorage // before loading this plugin if (typeof $.support.localStorage === "undefined") { - $.support.localStorage = !!window.localStorage; + var localStorageTest = function() { + try { + localStorage.setItem("test", "test"); + localStorage.removeItem("test"); + return true; + } catch(e) { + return false; + } + }; + $.support.localStorage = !!window.localStorage && localStorageTest(); } // modified getJSON which uses ifModified: true @@ -162,6 +171,7 @@ "NS_ERROR_DOM_QUOTA_REACHED") { cleanupLocalStorage(); } + break; } }