i have an object stored inside chrome storage that looks like this:
{
"planA":
{
123: {key: 'some key'}
124: {key: 'some other key'}
},
"planB":
{
223: {key: 'some key'}
234: {key: 'some other key'}
}
}
i want to do something like chrome.storage.sync.remove([{"planA": "123"}]);
but that seems not to work Error in response to storage.get: Error: Invalid value for argument 1. Value does not match any valid type choices.
from the documentation StorageArea.remove(string or array of string keys, function callback)
ant ideas?
Each extension has a "Inspect views: background page" link for this. With the extension's background page open, just go to the developer tools by pressing F12, then go to the Application tab. In the Storage section expand Local Storage. After that, you'll see all your browser's local storage there.
Web addresses you've visited are removed from the History page. Shortcuts to those pages are removed from the New Tab page. Address bar predictions for those websites are no longer shown.
localStorage is a property that allows JavaScript sites and apps to save key-value pairs in a web browser with no expiration date. This means the data stored in the browser will persist even after the browser window is closed.
You can't do that in a single API call. The API only gives access to top-level keys: you can get or set planA
as a whole.
So you'll need to write your own get/set functions, that retrieve the required top-level key, modify the object as required, and save it back.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With