显示chrome.storage中的所有内容
Show everything in chrome.storage
我尝试使用console.log(chrome.storage)
,但它没有返回任何帮助。我已经使用chrome.storage.sync.set
在我的扩展中设置了一些值,并希望看到它们。
我可以键入console.log(localStorage)
并查看其中的所有内容。如何使用chrome.storage做到这一点?
您必须等待chrome.storage.sync.set()
操作完成。其中一种方法是回调函数。使用chrome.storage.sync.set()
传递的值在回调中可用:
chrome.storage.sync.set({'key1': 123}, function() {
chrome.storage.sync.get("key1", function(data) {
console.log("data", data);
});
});
相关文章:
- 模拟chrome.storage.local函数使用Jasmine
- chrome.storage.sync未定义错误
- chrome.storage.local.get 如何设置值
- chrome.storage.sync.get未返回值-Angular服务
- 同步同步和本地 chrome.storage
- chrome.storage.local["mykey"] is undefined
- Chrome扩展 chrome.storage 如何同时进行大量获取和设置并避免竞争条件
- 显示chrome.storage中的所有内容
- 使用chrome.storage.get获取变量
- 从chrome.storage.local获取基元值
- chrome.storage.local.set using a variable key name
- 如何使用chrome.storage扩展
- 将客户端生成的密码短语存储在chrome.storage.local中的安全含义
- Chrome.storage:它能持续多久
- Chrome.storage.sync 在重新加载扩展程序时会被覆盖
- 使用 chrome.storage.sync 保存/获取嵌套对象
- 在 chrome.storage 中正确存储对象
- chrome.storage.sync.set variable key
- 如果扩展程序的文件发生更改,请更新 chrome.storage
- 从“选项”弹出窗口中选择一个值,然后将其保存到 Chrome.storage,以便在后台脚本中用作值