From 30253ddb9c3000e408e05026c36b3af77d3d4db7 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 12 Feb 2013 17:58:07 +0000 Subject: [PATCH] dont fail if third party localStorage is not enaled, closes #1244 --- source/Ox/js/Core.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/Ox/js/Core.js b/source/Ox/js/Core.js index 1fefc39e..284ecc5b 100644 --- a/source/Ox/js/Core.js +++ b/source/Ox/js/Core.js @@ -91,9 +91,11 @@ Ox.localStorage 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 = {};