Javascript 使用chrome.storage.sync获取数据
如何从中获取数据Javascript 使用chrome.storage.sync获取数据,javascript,google-chrome,google-chrome-extension,local-storage,Javascript,Google Chrome,Google Chrome Extension,Local Storage,如何从中获取数据 chrome.storage.sync.get 把他的值存储在一个变量上? 我一直在chrome extension中创建一个CRUD,但是当尝试Retrieve数据时,它看起来像chrome.storage.sync.get不返回数据 const STORAGE=chrome.STORAGE.sync; 函数getURLs(){ 让URL=[]; STORAGE.get([“url”],result=>{ URL=result.url | |[]; }); 返回URL; }
chrome.storage.sync.get
把他的值存储在一个变量上?
我一直在chrome extension中创建一个CRUD,但是当尝试Retrieve数据时,它看起来像chrome.storage.sync.get
不返回数据
const STORAGE=chrome.STORAGE.sync;
函数getURLs(){
让URL=[];
STORAGE.get([“url”],result=>{
URL=result.url | |[];
});
返回URL;
}
有什么帮助吗?感谢您将此答案格式化。此答案很有用,但仍然找不到正确的答案。谢谢你的关注。已经找到了答案,非常感谢你成为代码英雄!!感谢您将此答案格式化。此答案很有用,但仍然找不到正确的答案。谢谢你的关注。已经找到了答案,非常感谢你成为代码英雄!!