但是,当我使用chrome.storage.local.get访问此数据时,控制台返回的值是undefined,而不是已保存的值。chrome.storage.sync.get(["txt"], function(data) { # console says "value currently is undefined
我想通过chrome.storage.local.get()从chrome存储中获取2个值,但是如果我试图从回调函数中返回这些值,我得到的结果是'undefined‘。为什么会这样呢?我在其他一些帖子中读到,我需要使用回调-但就我对JS的基本理解而言,我已经从get()的回调函数中返回了值。this should load 2 keys from an object stored in chrome storage
function load
在我的Google扩展版的background.js中,我有: chrome.storage.local.get( if (typeof value === "undefined") {var surveyID = 0;} else {var surveyIDconsole.log("value of currentSurveyID read as
但是,在下面的displayAdParams中,即使在getTabParamsFromStorage没有返回promise/not fulfilled的情况下,第二个then块仍在执行。'a', items[tabId]); });popup.js:7 b undefinedTypeError: Cannot read property 'shift' of und