Reputation: 380
I set it like this:
chrome.storage.local.set({
myState: {
data: {
website: "google.com",
visited: false,
count: 0
}
}
})
If I want to change myState.data.visited to true, what should I do?
Upvotes: 1
Views: 1420
Reputation: 2032
You need to get the data, change it and save it again.
chrome.storage.local.get('storageKey', function(result) {
//data.visited will be in the result object for a specific key. You can change data.visited
//to be true here. After changing it to true you can save it again under
//the key 'storageKey' or any key you like.
chrome.storage.local.set({storageKey: result});
});
Upvotes: 3