Last Comment Bug 716963 - sessionStorage doesn't work in file:/// documents
: sessionStorage doesn't work in file:/// documents
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM (show other bugs)
: Trunk
: All All
: -- normal with 1 vote (vote)
: ---
Assigned To: Honza Bambas (:mayhemer)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-10 11:07 PST by Wes Kocher (:KWierso)
Modified: 2013-04-04 13:53 PDT (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Test case (399 bytes, text/html)
2012-01-10 11:07 PST, Wes Kocher (:KWierso)
no flags Details

Description Wes Kocher (:KWierso) 2012-01-10 11:07:57 PST
Created attachment 587396 [details]
Test case

+++ This bug was initially created as a clone of Bug #507361 +++

Bug 507361 fixed this for localStorage, but it seems like sessionStorage still has this problem.

If I open this test file in a current Nightly build, I see the following error logged to the error console:
Timestamp: 1/10/2012 11:29:27 AM
Error: uncaught exception: [Exception... "Operation is not supported"  code: "9" nsresult: "0x80530009 (NS_ERROR_DOM_NOT_SUPPORTED_ERR)"  location: "file:///C:/Users/admin/Desktop/mytest.html Line: 11"]


If I change from using sessionStorage to using localStorage in the test file, it works just fine.

Bug 357323 was about sessionStorage, and it was duped to bug 507361, saying 357323 was fixed by 507361. (I do see a different error than what bug 357323 mentioned, but it still doesn't work for me.)
Comment 1 Honza Bambas (:mayhemer) 2012-01-10 12:36:13 PST
This code:

http://hg.mozilla.org/mozilla-central/annotate/011e3cef6068/docshell/base/nsDocShell.cpp#l2277

needs also update to support file scheme and define a domain for it.  In that bug we made it a directory for files:

https://bugzilla.mozilla.org/attachment.cgi?id=550808&action=diff#a/dom/src/storage/nsDOMStorageDBWrapper.cpp_sec2

I don't think that having a generic way of getting a domain would be useful, since this is only valid use case for DOM storage.

Would be nice to have just a single place of the code that would get the 'domain' for storage mapping.  Now we will duplicate it.  Probably the storage manager will be the place.
Comment 2 Jay 2012-01-25 01:15:38 PST
We are having the same problem, seems that localStorage for "file://" domains was fixed in 8, but not sessionStorage.
Comment 3 Honza Bambas (:mayhemer) 2012-02-24 14:30:09 PST
Can please anyone test with latest nightly builds whether this has been fixed?  I've landed bug 495337 that might well fixed this bug.
Comment 4 Wes Kocher (:KWierso) 2012-02-24 14:46:37 PST
(In reply to Honza Bambas (:mayhemer) from comment #3)
> Can please anyone test with latest nightly builds whether this has been
> fixed?  I've landed bug 495337 that might well fixed this bug.

My test case attached to the bug no longer logs any errors, and it alerts "N,Y,0".
So I guess it works?
Comment 5 Honza Bambas (:mayhemer) 2012-02-24 15:03:45 PST
(In reply to Wes Kocher (:KWierso) (Jetpack Bugmaster) from comment #4)
> (In reply to Honza Bambas (:mayhemer) from comment #3)
> > Can please anyone test with latest nightly builds whether this has been
> > fixed?  I've landed bug 495337 that might well fixed this bug.
> 
> My test case attached to the bug no longer logs any errors, and it alerts
> "N,Y,0".
> So I guess it works?

Thanks!  I will close this bug for now.

If the issue appears again then PLEASE FILE NEW BUGS RATHER THEN REOPENING THIS ONE.

Note You need to log in before you can comment on or make changes to this bug.