Just want to ask on how to update some data in extension's storage.
This is how I set the data in chrome.storage
:
var storage = chrome.storage.local;
var obj = {},
clientInfo = [];
clientInfo.push({
"name" : "alde",
"age" : "21"
});
obj['clientInfo'] = clientInfo;
storage.set(obj,function(){});
I want to add another obj in ClientInfo
array like this:
clientInfo.push({
"name" : "another name",
"age" : 33
});
EDITED
Currently, I still need to get the array to manipulate and save it back to update my storage, I just thought that maybe there's a simplest way to do it.
My problem is just that I have many js files running at the same time and can't append the object synchronously.