content_script を介して拡張機能で chrome ストレージを使用しようとしていますが、失敗し続けます
Uncaught TypeError: Cannot read property 'sync' of undefined
これは私のコードです:
testChromeStorage();
function testChromeStorage() {
console.log("Saving");
chrome.storage.sync.set({'value': theValue}, function() {
message('Settings saved');
});
chrome.storage.sync.get("value", function (retVal) {
console.log("Got it? " + retVal.value);
});
}