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

RESOLVED DUPLICATE of bug 600307

Status

()

Core
DOM
RESOLVED DUPLICATE of bug 600307
10 years ago
4 years ago

People

(Reporter: Ralf Stoltze, Unassigned)

Tracking

unspecified
x86
Windows XP
Points:
---
Bug Flags:
blocking1.9.2 -

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

10 years ago
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

Comment 2

9 years ago
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-
Duplicate of this bug: 573271

Comment 5

8 years ago
Created attachment 452539 [details]
testcase

Comment 6

8 years ago
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.

Comment 8

8 years ago
Is there any hope of eliminating this error in Firefox 3.7?
Duplicate of this bug: 661769
Might be also related to bug 600366.
See Also: → bug 600366
Releasing for now, any one feel free to take this.
Assignee: honzab.moz → nobody
(Assignee)

Updated

5 years ago
Component: DOM: Mozilla Extensions → DOM
Product: Core → Core

Comment 13

5 years ago
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
Last Resolved: 5 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 600307

Comment 15

4 years ago
This bug is fixed. Tested testcase on Firefox 31, 32.
You need to log in before you can comment on or make changes to this bug.