storage.StorageArea

StorageArea is an object representing a storage area.

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.set()
Stores one or more items in the storage area. If an item already exists, its value will be updated.
storage.StorageArea.remove()
Removes one or more items from the storage area.
storage.StorageArea.clear()
Removes all items from the storage area.

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
StorageArea
Yes
14
45
?
Yes
14
?
?
48
?
?
?
clear
Yes
14
45
?
33
14
?
?
48
?
?
?
get
Yes
14
45
?
33
14
?
?
48
?
?
?
getBytesInUse
Yes
14
78
Only supported by the sync storage area.
?
33
14
?
?
No
?
?
?
remove
Yes
14
45
?
33
14
?
?
48
?
?
?
set
Yes
14
storage is limited to 1MB per value.
45
?
33
14
?
?
48
?
?
?

Note: This API is based on Chromium's chrome.storage API. This documentation is derived from storage.json in the Chromium code.

Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage/StorageArea