chrome.storage
The storage areas of an extension (src/extensions/storage.odin; src/page/ext_api.odin). local and sync are written to the profile; session lives in memory until the browser exits or the extension reloads; managed is empty (no policy sets it). Values are JSON.
Gate: permission storage; contexts: Background, Popup, Tab, Content. Source: api/ext_storage.widl.
Events
| Event | Listener's parameters | Gate | |
|---|---|---|---|
onChanged | object changes, AreaName areaName | changes: an object of StorageChange by key. |
Types
Keys
The keys of get, remove and getBytesInUse: one key, a list of keys, or an object of keys with their defaults.
One of: string or string[] or object.
AreaName
A string: "local", "sync", "managed", "session". chrome.storage.AreaName names them.
StorageChange
| Property | Type | |
|---|---|---|
oldValue (optional) | any | |
newValue (optional) | any |
AccessOptions
| Property | Type | |
|---|---|---|
accessLevel | string |