【发布时间】:2021-08-15 10:28:42
【问题描述】:
我有两个电话给chrome.storage.local.get()。在继续为我的 chrome 扩展程序执行其余代码(调用 continueCode() 函数)之前,我需要完成这些调用,但我不确定如何执行此操作,这是我的代码。
function getData() {
chrome.storage.local.get(['key'], function(result) {
if (Object.values(result)[0] != undefined) {
object1.innerHTML = Object.values(result)[0].val;
}
});
chrome.storage.local.get(['key2'], function(result) {
if (Object.values(result)[0] != undefined) {
object2.innerHTML = Object.values(result)[0].val;
}
});
continueCode();
}
【问题讨论】:
标签: asynchronous google-chrome-extension google-chrome-storage