Getting Multiple items from Chrome storage?
As per the official documentation it will be as below.
chrome.storage.sync.get([
'customImage',
'customColor',
'customRandColor',
'customRandImage'
], function(backgroundCheckedOptions) {
document.getElementById('optionsCustomImage').checked = backgroundCheckedOptions.customImage;
document.getElementById('optionsBackgroundColor').checked = backgroundCheckedOptions.customColor;
document.getElementById('optionsRandomColor').checked = backgroundCheckedOptions.customRandColor;
document.getElementById('optionsRandomImage').checked = backgroundCheckedOptions.customRandImage;
});
From the Chrome Storage documentation, it says:
StorageArea.get(string or array of string or object keys, function callback)
Easiest would be to pass an array by replacing your {}
with []