从 Chrome 存储中获取所有键:值

Get all Keys:Values from Chrome Storage

本文关键字:获取 Chrome 存储      更新时间:2023-09-26

>我通过将null作为对象传递来获取Chrome Storage的所有密钥。

例如

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

有没有类似的方法可以从Chrome存储中获取所有属性:属性值对?

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

我实现了通过循环