How do I place an Object within an Object within chrome.storage.sync.set
The outcome I'm needing is, so I can then search the Value and then pull the data like name and path
0:ID {
Name: Name of file
Path: Path Location
Enabled: true
}
1:ID{
Name: Name of file
Path: Path Location
Enabled: true
}
2:ID{
Name: Name of file
Path: Path Location
Enabled: true
}
I've used
var save = {};
save.id = {};
save.id.name = "Name of File";
save.id.path = "Path of File";
save.id.enable = "1";
chrome.storage.sync.set(save, function() {
console.log('Value is set to ' + save);
});
chrome.storage.sync.get(['save'], function(result) {
console.log('Value currently is ' + result.value);
});
But its not working, how would I be able to search the ID and then pull the relevant data from that ID?