1

How can I get data from

 chrome.storage.sync.get

and store his value on a variable? I have been creating a CRUD within chrome extension but when trying to Retrieve the data, it looks like chrome.storage.sync.get don't return data.

const STORAGE = chrome.storage.sync;

function getURLs() {
  let urls = [];
  STORAGE.get(["urls"], result => {
    urls = result.urls || [];
  });
  return urls;
}

Any help?

0 Answers0