Closed Bug 426436 Opened 16 years ago Closed 11 years ago

After clearing DOM storage from 'Clear Recent History' dialog, saved properties are "" [empty string] instead of undefined

Categories

(Core :: DOM: Core & HTML, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 600307

People

(Reporter: ralf.stoltze, Unassigned)

References

()

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b4) Gecko/2008030714 Firefox/3.0b4

DOM storage can be cleared by clearing Cookies. However, stored values are not deleted (=== undefined), but set to the empty string (=== ""). I used Tools - Clear private data to delete cookies. This happens with both domains that are and are not in the offline app list.

Reproducible: Always

Steps to Reproduce:
1. Go to http://2meter3.de/offline/domstorage.html
2. Refresh a couple times, while the counter increases
3. Click Tools - Clear private data (having cookies selected)
4. Refresh again
Actual Results:  
storage.pageLoadCount.value === ""

Expected Results:  
storage.pageLoadCount.value === undefined
This is real, and of course sensitive data can be stored just as well in the property names as in the values.

Workaround: Restart Firefox after step 3.

I'm pretty sure the bug is not in the DOM code that talks to SQLite.  Rather the JavaScript engine remembers which properties you looked up.  nsStorageSH::NewResolve calls JS_DefineUCProperty.

I don't know if XPConnect exposes enough hooks to fix this in
nsDOMClassInfo.{h,cpp} or not.
Status: UNCONFIRMED → NEW
Ever confirmed: true
The test for bug 463000 had to be changed to take this bug into account.  A fix for this bug will need to update that test too.
Assignee: nobody → honzab.moz
Summary: After clearing DOM storage, saved properties are "" [empty string] instead of undefined → After clearing DOM storage from 'Clear Recent History' dialog, saved properties are "" [empty string] instead of undefined
Flags: blocking1.9.2?
Not blocking 1.9.2 on this per discussion with Honza.
Flags: blocking1.9.2? → blocking1.9.2-
Attached file testcase
Yes, commited:

"Clear Recent History ..." tool does not remove sessionStorage keys/values
pairs, but changes values to empty strings and keys are (unfortunately) not
cleared.


Reproducible: Always

Steps to Reproduce:

1. oper testcase or URL
2. follow the instructions

Actual Results:  

"Clear Recent History ..." tool does not remove sessionStorage keys/values
pairs


Expected Results:  

"Clear Recent History ..." changes sessionStorage values to empty strings and
keys are (unfortunately) not cleared.
Is there any hope of eliminating this error in Firefox 3.7?
Might be also related to bug 600366.
See Also: → 600366
Releasing for now, any one feel free to take this.
Assignee: honzab.moz → nobody
Component: DOM: Mozilla Extensions → DOM
I think this is fixed following the landing of bug 600307.  In the latest nightlies, using History->Clear recent history removes all storage items, although there is still bug 527667 concerning time ranges.  Calling nsICookieManager.removeAll() also now removes all the sessionStorage keys.
(In reply to Ian Nartowicz from comment #13)
> I think this is fixed following the landing of bug 600307.  In the latest
> nightlies, using History->Clear recent history removes all storage items,
> although there is still bug 527667 concerning time ranges.  Calling
> nsICookieManager.removeAll() also now removes all the sessionStorage keys.

I can confirm bug 527667 is still left open.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
This bug is fixed. Tested testcase on Firefox 31, 32.
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: