I'm have a strange issue in Firefox only.
I'm saving items to localStorage (one of which is a pretty large JSON object that I've stringified with JSON.stringify). The problem is that when I try to use removeItem() on the localStorage object it clears the entire thing. All the properties get cleared. But if I refresh the page the properties come back. This works in Safari, Chrome and Opera (latest versions) but only Firefox has this weird issue.
I've isolated the problem to a single line where I call localStorage.removeItem("value"). Has anyone seen anything like this before?
I've even done some debugging with the "storage" event on the window object, just to see what's happening. I included the output of that below. All this comes back when I try to delete one property, any property.
altKey undefined
attrChange undefined
attrName undefined
bubbles false
cancelable false
ctrlKey undefined
currentTarget Window weekend-getaways
data undefined
delegateTarget Window weekend-getaways
eventPhase 2
handleObj Object { type="storage", origType="storage", guid=9}
jQuery17207456704310204192 true
metaKey undefined
originalEvent storage
relatedNode undefined
relatedTarget undefined
shiftKey undefined
srcElement undefined
target Window weekend-getaways
timeStamp 1340773330422505
type "storage"
view undefined
which undefined
isDefaultPrevented returnFalse()
isImmediatePropagationStopped returnFalse()
isPropagationStopped returnFalse()
preventDefault function()
stopImmediatePropagation function()
stopPropagation function()
proto Object { preventDefault=function(), stopPropagation=function(), stopImmediatePropagation=function(), more...} storage changed cityli...0771360 (line 55)
altKey undefined
attrChange undefined
attrName undefined
bubbles false
cancelable false
ctrlKey undefined
currentTarget Window weekend-getaways
data undefined
delegateTarget Window weekend-getaways
eventPhase 2
handleObj Object { type="storage", origType="storage", guid=9}
jQuery17207456704310204192 true
metaKey undefined
originalEvent storage
relatedNode undefined
relatedTarget undefined
shiftKey undefined
srcElement undefined
target Window weekend-getaways
timeStamp 1340773330470620
type "storage"
view undefined
which undefined
isDefaultPrevented returnFalse()
isImmediatePropagationStopped returnFalse()
isPropagationStopped returnFalse()
preventDefault function()
stopImmediatePropagation function()
stopPropagation function()
proto Object { preventDefault=function(), stopPropagation=function(), stopImmediatePropagation=function(), more...} storage changed cityli...0771360 (line 55)
altKey undefined
attrChange undefined
attrName undefined
bubbles false
cancelable false
ctrlKey undefined
currentTarget Window weekend-getaways
data undefined
delegateTarget Window weekend-getaways
eventPhase 2
handleObj Object { type="storage", origType="storage", guid=9}
jQuery17207456704310204192 true
metaKey undefined
originalEvent storage
relatedNode undefined
relatedTarget undefined
shiftKey undefined
srcElement undefined
target Window weekend-getaways
timeStamp 1340773331099462
type "storage"
view undefined
which undefined
isDefaultPrevented returnFalse()
isImmediatePropagationStopped returnFalse()
isPropagationStopped returnFalse()
preventDefault function()
stopImmediatePropagation function()
stopPropagation function()
proto Object { preventDefault=function(), stopPropagation=function(), stopImmediatePropagation=function(), more...} storage changed cityli...0771360 (line 55)
altKey undefined
attrChange undefined
attrName undefined
bubbles false
cancelable false
ctrlKey undefined
currentTarget Window weekend-getaways
data undefined
delegateTarget Window weekend-getaways
eventPhase 2
handleObj Object { type="storage", origType="storage", guid=9}
jQuery17207456704310204192 true
metaKey undefined
originalEvent storage
relatedNode undefined
relatedTarget undefined
shiftKey undefined
srcElement undefined
target Window weekend-getaways
timeStamp 1340773332394871
type "storage"
view undefined
which undefined
isDefaultPrevented returnFalse()
isImmediatePropagationStopped returnFalse()
isPropagationStopped returnFalse()
preventDefault function()
stopImmediatePropagation function()
stopPropagation function()
proto Object { preventDefault=function(), stopPropagation=function(), stopImmediatePropagation=function(), more...} storage changed cityli...0771360 (line 55)
altKey undefined
attrChange undefined
attrName undefined
bubbles false
cancelable false
ctrlKey undefined
currentTarget Window weekend-getaways
data undefined
delegateTarget Window weekend-getaways
eventPhase 2
handleObj Object { type="storage", origType="storage", guid=9}
jQuery17207456704310204192 true
metaKey undefined
originalEvent storage
relatedNode undefined
relatedTarget undefined
shiftKey undefined
srcElement undefined
target Window weekend-getaways
timeStamp 1340773332395014
type "storage"
view undefined
which undefined
isDefaultPrevented returnFalse()
isImmediatePropagationStopped returnFalse()
isPropagationStopped returnFalse()
preventDefault function()
stopImmediatePropagation function()
stopPropagation function()
proto Object { preventDefault=function(), stopPropagation=function(), stopImmediatePropagation=function(), more...} storage changed cityli...0771360 (line 55)
altKey undefined
attrChange undefined
attrName undefined
bubbles false
cancelable false
ctrlKey undefined
currentTarget Window weekend-getaways
data undefined
delegateTarget Window weekend-getaways
eventPhase 2
handleObj Object { type="storage", origType="storage", guid=9}
jQuery17207456704310204192 true
metaKey undefined
originalEvent storage
relatedNode undefined
relatedTarget undefined
shiftKey undefined
srcElement undefined
target Window weekend-getaways
timeStamp 1340773361375308
type "storage"
view undefined
which undefined
isDefaultPrevented returnFalse()
isImmediatePropagationStopped returnFalse()
isPropagationStopped returnFalse()
preventDefault function()
stopImmediatePropagation function()
stopPropagation function()
proto Object { preventDefault=function(), stopPropagation=function(), stopImmediatePropagation=function(), more...} storage changed cityli...0771360 (line 55)