I\'m trying to use chrome\'s local storage / sync storage (chrome.storage) for an extension, to store data entries, for many different entries. I can\'t seem to figure out
the set
method accepts object items, and an optional callback, the get
accepts optional string or array or object keys and if you passed the first argument, you got to pass the second argument as well.
Example:
// To set
chrome.storage.local.set({'testKey':'Test Value'});
// To get
chrome.storage.local.get('testKey', function(data){
console.log(data);
// logs out "Object {testKey: "Test Value"}"
})