Trying to set and get values in my Chrome extension using local storage. Don't know what I did, but it's no longer working.¨
In manifest I have:
"permissions": [
"tabs", "http://*/*", "https://*/*", "storage"
],
This is the complete js, which sets a value and then tries to read it:
chrome.storage.local.set({'userid': "foo"}, function (result) {
chrome.storage.local.get('userid', function (result) {
alert(userid.result);
});
});
The alert says "undefined", not "foo" as expected.
The js is executed when i go to a certain page, specified in manifest for "content_scripts".