dont fail if third party localStorage is not enaled, closes #1244

This commit is contained in:
j 2013-02-12 17:58:07 +00:00
parent c5f038a526
commit 30253ddb9c

View file

@ -91,9 +91,11 @@ Ox.localStorage <f> localStorage wrapper
{}
@*/
Ox.localStorage = function(namespace) {
var localStorage = window.localStorage || {};
// FF 3.6 can't assign to or iterate over localStorage
var localStorage;
try {
// this will fail if third party cookies/storage is not allowed
localStorage = window.localStorage || {};
// FF 3.6 can't assign to or iterate over localStorage
Ox.forEach(localStorage, function(value, key) {});
} catch (e) {
localStorage = {};