chrome.storage.local.get( {key:null}, ... ) results in empty response object?

2,562 views
Skip to first unread message

Matt Kruse

unread,
Aug 27, 2012, 12:01:08 PM8/27/12
to chromium-...@chromium.org
Following the specs at:
http://developer.chrome.com/dev/extensions/storage.html
I am trying to get a value, with the default value being null. However, when I do this:

chrome.storage.local.set( {"key":"val"}, function() {
    chrome.storage.local.get( {"key":null}, function(o) {
        alert(o.key);
    });
});

I get "undefined" when I expect "val". If I replace the default with anything non-null, I get "val" back correctly.

Is this a bug in chrome.storage? Or is that the intended operation? Or am I doing something wrong?

Thanks!

Matt Kruse

Mihai Parparita

unread,
Aug 27, 2012, 4:03:51 PM8/27/12
to Matt Kruse, chromium-...@chromium.org
This sounds like a bug. Can you report it at http://new.crbug.com/ (if you send me the link once it's filed, I can make sure it ends up with the right labels/owner).

Mihai



Matt Kruse

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msg/chromium-extensions/-/0ynUV_l0TU8J.
To post to this group, send email to chromium-...@chromium.org.
To unsubscribe from this group, send email to chromium-extens...@chromium.org.
For more options, visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/?hl=en.

Matt Kruse

unread,
Aug 27, 2012, 5:27:26 PM8/27/12
to chromium-...@chromium.org, Matt Kruse
Hope I did this right :)
https://code.google.com/p/chromium/issues/detail?id=145081

Matt




On Monday, August 27, 2012 3:03:51 PM UTC-5, Mihai Parparita wrote:
This sounds like a bug. Can you report it at http://new.crbug.com/ (if you send me the link once it's filed, I can make sure it ends up with the right labels/owner).

Mihai

On Mon, Aug 27, 2012 at 9:01 AM, Matt Kruse <matthew...@gmail.com> wrote:
Following the specs at:
http://developer.chrome.com/dev/extensions/storage.html
I am trying to get a value, with the default value being null. However, when I do this:

chrome.storage.local.set( {"key":"val"}, function() {
    chrome.storage.local.get( {"key":null}, function(o) {
        alert(o.key);
    });
});

I get "undefined" when I expect "val". If I replace the default with anything non-null, I get "val" back correctly.

Is this a bug in chrome.storage? Or is that the intended operation? Or am I doing something wrong?

Thanks!


Matt Kruse

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msg/chromium-extensions/-/0ynUV_l0TU8J.
To post to this group, send email to chromium-...@chromium.org.
To unsubscribe from this group, send email to chromium-extensions+unsub...@chromium.org.
Reply all
Reply to author
Forward
0 new messages