0

I tried to implement the solution to the previous question here:chrome.storage set\get clarification

Does this answer still work? Because I used the example given (and have tried the others knocking about, but none seem to work for me.

The code in question is:

chrome.storage.sync.set({'value': 12}, function() {
  chrome.storage.sync.get("value", function(data) {
    console.log("data", data);
  });
});

and I have the permissions in the Manifest, but the result is:

data Object {} 

Thanks!

Community
  • 1
  • 1
Hetman
  • 1
  • 2
    Works for me.. That exact code produces expected result. But, you're using `sync` storage, that has hard rate limits. Try adding `console.log(chrome.runtime.lastError)` before `get` inside the callback. – Xan Oct 29 '14 at 22:05
  • It seems to be working now! I am a little confused as to why it was not working before. Thanks for the help – Hetman Nov 02 '14 at 20:48

0 Answers0