With WebExtensions how can I use browser.storage.sync.set
to save a value to a (deeply) nested property in the storage?
Let’s say I have the following storage object:
{ settings: { a: { x: [1,2] }, x: 0 } }
I would like to change the 2. array element in settings.a.x
(not to confuse with settings.x
!)
how could I accomplish this?
Note: browser.storage.sync.set({ settings: { a: { x: [2,3] }}})
seems to overwrite the whole settings object (deleting settings.x
) - and also I would only like to change the array’s 2. element.