Currently the
get() method only accepts three parameters:
"A single key to get, list of keys to get, or a dictionary specifying default values (see description of the object)." (Source)
If you are storing a lot of data in chrome.storage, it can be more efficient to have the ability to get a subkey in some scenarios. Example
{
"tom": { lots of data },
"dick": {
"fullname": "..."
"phone": "...",
"email": "...",
"history": { lots of data }
},
"harry": { lots of data }
}
If I just want to retrieve Dick's email, I would prefer to get only the email subkey instead of the entire dick key, which contains a huge amount of data in history. It would be great if I could pull that off by doing something like this:
chrome.storage.local.get(dick.email, function(items) {
// Do something with Dick's email and only Dick's email
console.log('Dick\'s email is ' + items['email']);
});