Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion lib/jquery.offline.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -162,6 +171,7 @@
"NS_ERROR_DOM_QUOTA_REACHED") {
cleanupLocalStorage();
}
break;
}
}

Expand Down