AlexRee / chromedevtools

Automatically exported from code.google.com/p/chromedevtools
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

HTML5 localStorage is undefined #48

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Google Chrome version: 13.0.782.107
SDK + Eclipse Debugger version(s): 3.7.0
OS + version: Ubuntu 11.04

What steps will reproduce the problem?
1. prepare a project and enter the following code as script
1. localStorage.setItem("test", "info");
2. localStorage.getItem("test");

What is the expected result?
localStorage.getItem("test") == "info"

What happens instead?
localStorage.getItem("test") == undefined

Is it possible to use this HTML5 feature? The problem is, that I need to 
write/read the localStorage, but I always get "undefined".

Original issue reported on code.google.com by aflx...@gmail.com on 4 Aug 2011 at 7:19

GoogleCodeExporter commented 9 years ago
I have to specify this issue a little:

undefined is only displayed in the variables view under <GLOBAL>
If I assign the result of localStorage.getItem("test") to a varibale it 
contains the right value.

Original comment by aflx...@gmail.com on 5 Aug 2011 at 6:26

GoogleCodeExporter commented 9 years ago
Could you please describe your steps more in Eclipse terms?
Like start debugger, add watch expression etc.

Is is a problem with debugger or a problem with HTML5?

Peter

Original comment by peter.ry...@gmail.com on 5 Aug 2011 at 7:13

GoogleCodeExporter commented 9 years ago
Hi Peter,

I think it is a problem of the debugger. If you start the debugger, wait until 
it holds on a breakpoint and go to the variables view, there you will see that 
all items under localStorage are "undefined".

If you do the same in the script view of Google Chrome (ctrl+shift+j) 
everything is fine. You will see that all localStorage variables under "Scope 
Variables" are defined.

I think this is not a critcal bug, but sometimes it would be great if you could 
see the content of the localStorage on runtime.

Alex

Original comment by aflx...@gmail.com on 6 Aug 2011 at 6:02

GoogleCodeExporter commented 9 years ago
I have filed a new issue 
http://code.google.com/p/chromedevtools/issues/detail?id=49
Hope you don't mind. You will need to star it if you want to watch the changes.

Original comment by peter.ry...@gmail.com on 8 Aug 2011 at 11:16

GoogleCodeExporter commented 9 years ago

Original comment by peter.ry...@gmail.com on 8 Aug 2011 at 11:16

GoogleCodeExporter commented 9 years ago
Thanks a lot! The next time I will write a better report :-)

Original comment by aflx...@gmail.com on 9 Aug 2011 at 5:50