Page is a not externally linkable
coopster - 1:01 pm on Jan 30, 2013 (gmt 0)
Firefox has a little security feature built in that won't allow localStorage (HTML5 feature) access if you have custom cookie options set. Well, being a developer I need full control over each cookie that pops so I can monitor and check values as they are get/set.
I ran into this last April after a Firefox update rendered the Facebook site half-operational and no errors being thrown. And rather than take the time to troubleshoot I uninstalled Firefox and installed a fresh, clean copy without any add-ons. Of course, I went into the custom options immediately and changed the cookie settings so I could be asked every time. If I would have left the default values Firefox would have worked on Facebook. But, since I modified the settings I found that Facebook still wasn't working. At the time I didn't realize where the issue lied so I just used my tablet when I wanted to check in at Facebook. Or a different browser. Frustrating? Oh yes, but I figured it was a Facebook code issue and left it at that.
Fast forward to a custom contract where I decided to use HTML5 localStorage (http://dev.w3.org/html5/webstorage/) and I kept getting errors when testing in my browser. Armed with my new keyword (localStorage) I did an internet search and came across a bug report as well as a blog post, both authored by Eric Meyer:
https://bugzilla.mozilla.org/show_bug.cgi?id=748620
[meyerweb.com...]
Turns out that Meyer ran into the problem about the same time I did but he took the time to figure out what was going on.
So, I waited way too long to post this in a Firefox browser forum but figured it should be laid out for others who are either
try {
localStorage.foo = localStorage.foo == 'undefined'
? 'true'
: localStorage.foo
;
} catch (e) {
// set your own handler or use a polyfill:
// https://developer.mozilla.org/en-US/docs/DOM/Storage OR
// https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-browser-Polyfills
}