问题
I'm playing around with HTML5. For that purpose I created some small Javascript widget using localStorage amongst other things. Up until yesterday Firefox played nice.
Then 6.0.2 came around and suddenly the localStorage object is null.
Going to http://html5test.com shows that Local Storage is not supported.
Using Chrome to view the exact same code (found at http://scriptonomicon.dk/CCDashboard/index.html) works fine. Using Firefox 6.0.2 on Windows (7) works just fine.
Has anyone else experienced that localstorage is broken on Firefox 6.0.2 on Mac?
回答1:
You should check the storage preferences, type about:config
into the location bar. The relevant preferences are:
dom.storage.enabled
- should obviously betrue
dom.storage.default_quota
- default value is5120
回答2:
Works fine for me:
回答3:
I had this problem too, on Firefox 6.0.2 on Windows. Tried on two different PCs. Gets weirder though, as the flags in about:config were set correctly and the html5test.com indicator said it's supported. It definitely wasn't though - I spent 4 hours pulling my hair out at a simple implementation of setItem / getItem which just did not work. Fine in Chrome.
In the end I think I have resolved it though. Are you working locally on the filesystem by any chance? Try working from a proper domain or setting up local DNS for a test domain locally - that has done the trick for me - it now works!
来源:https://stackoverflow.com/questions/7355324/did-localstorage-just-break-in-firefox-6-0-2-on-mac