storage.StorageArea
StorageArea is an object representing a storage area. This documentation describes the common interface of these concrete implementations:
storage.StorageArea is not an API object; it is a mechanism for describing the concrete APIs.
Type
Values of this type are objects.
Methods
storage.StorageArea.get()-
Retrieves one or more items from the storage area.
storage.StorageArea.getBytesInUse()-
Gets the amount of storage space (in bytes) used one or more items being stored in the storage area.
storage.StorageArea.getKeys()-
Retrieves the keys of all items in the storage area.
storage.StorageArea.set()-
Stores one or more items in the storage area. If an item already exists, its value will be updated.
storage.StorageArea.setAccessLevel()-
Sets the access level for the storage area.
storage.StorageArea.remove()-
Removes one or more items from the storage area.
storage.StorageArea.clear()-
Removes all items from the storage area.
Events
storage.StorageArea.onChanged-
Fires when one or more items in the storage area change.
Browser compatibility
| desktop | mobile | ||||||
|---|---|---|---|---|---|---|---|
StorageArea
|
|
|
|
|
|
|
|
clear
|
|
|
|
|
|
|
|
get
|
|
|
|
|
|
|
|
|
Supports empty key
|
|
|
|
|
|
|
|
getBytesInUse
|
|
|
|
|
|
|
|
getKeys
|
|
|
|
|
|
|
|
onChanged
|
|
|
|
|
|
|
|
remove
|
|
|
|
|
|
|
|
|
Supports empty key
|
|
|
|
|
|
|
|
set
|
|
|
|
|
|
|
|
setAccessLevel
|
|
|
|
|
|
|
|
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- See implementation notes.
Note:
This API is based on Chromium's chrome.storage API. This documentation is derived from storage.json in the Chromium code.