admin管理员组

文章数量:1332345

I got all keys from Chrome Storage by passing null as object.

For example,

chrome.storage.local.get(null, callbackFunction); //list of Object property

Is there any way similarly to get all property:propertyValues pairs from Chrome Storage?

I got all keys from Chrome Storage by passing null as object.

For example,

chrome.storage.local.get(null, callbackFunction); //list of Object property

Is there any way similarly to get all property:propertyValues pairs from Chrome Storage?

Share Improve this question edited Feb 21, 2016 at 13:06 D09r asked Feb 20, 2016 at 14:47 D09rD09r 1,4111 gold badge13 silver badges17 bronze badges 3
  • 1 What do you mean all keys: values? Chrome storage will return you a single object will all the stored data. – Dmitri Pavlutin Commented Feb 20, 2016 at 15:24
  • I mean, how to get all property:propertyValues in an Object. – D09r Commented Feb 21, 2016 at 13:03
  • 3 chrome.storage.local.get(function(items) { console.log(items) }); – Dmitri Pavlutin Commented Feb 21, 2016 at 13:48
Add a ment  | 

1 Answer 1

Reset to default 8
chrome.storage.local.get(null, function(items) {
   for (key in items) {
       //do stuffs here
   }
});

I achieved through for loop

本文标签: javascriptGet all KeysValues from Chrome StorageStack Overflow