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
Chrome
Edge
Firefox
Opera
Safari
Firefox for Android
Safari on iOS
StorageArea
Chrome – Full support
Chrome 19 (Release date: 2012-05-15)
footnote Full support
Edge – Full support
Edge 14 (Release date: 2016-08-02)
footnote Full support
Firefox – Full support
Firefox 45 (Release date: 2016-03-08)
footnote Full support
Opera – Full support
Opera 33 (Release date: 2015-10-27)
footnote Full support
Safari – Full support
Safari 14 (Release date: 2020-09-16)
footnote Full support
Firefox for Android – Full support
Firefox for Android 48 (Release date: 2016-08-02)
footnote Full support
Safari on iOS – Full support
Safari on iOS 15 (Release date: 2021-09-20)
footnote Full support
clear
Chrome – Full support
Chrome 19 (Release date: 2012-05-15)
footnote Full support
Edge – Full support
Edge 14 (Release date: 2016-08-02)
footnote Full support
Firefox – Full support
Firefox 45 (Release date: 2016-03-08)
footnote Full support
Opera – Full support
Opera 33 (Release date: 2015-10-27)
footnote Full support
Safari – Full support
Safari 14 (Release date: 2020-09-16)
footnote Full support
Firefox for Android – Full support
Firefox for Android 48 (Release date: 2016-08-02)
footnote
footnote Doesn't support the managed storage area.
footnote Data isn't synchronized with the user's Mozilla account in the sync storage area. See bug 1625257
Safari on iOS – Full support
Safari on iOS 15 (Release date: 2021-09-20)
footnote Full support
get
Chrome – Full support
Chrome 19 (Release date: 2012-05-15)
footnote Full support
Edge – Full support
Edge 14 (Release date: 2016-08-02)
footnote Full support
Firefox – Full support
Firefox 45 (Release date: 2016-03-08)
footnote Full support
Opera – Full support
Opera 33 (Release date: 2015-10-27)
footnote Full support
Safari – Full support
Safari 14 (Release date: 2020-09-16)
footnote Full support
Firefox for Android – Full support
Firefox for Android 48 (Release date: 2016-08-02)
footnote
footnote Doesn't support the managed storage area.
footnote Data isn't synchronized with the user's Mozilla account in the sync storage area. See bug 1625257
Safari on iOS – Full support
Safari on iOS 15 (Release date: 2021-09-20)
footnote Full support
Supports empty key
Chrome – Full support
Chrome 19 (Release date: 2012-05-15)
footnote Full support
Edge – Full support
Edge 14 (Release date: 2016-08-02)
footnote Full support
Firefox – Full support
Firefox 45 (Release date: 2016-03-08)
footnote Full support
Opera – Full support
Opera 33 (Release date: 2015-10-27)
footnote Full support
Safari – Full support
Safari 18 (Release date: 2024-09-16)
footnote Full support
Firefox for Android – Full support
Firefox for Android 48 (Release date: 2016-08-02)
footnote Full support
Safari on iOS – Full support
Safari on iOS 18 (Release date: 2024-09-16)
footnote Full support
getBytesInUse
Chrome – Full support
Chrome 19 (Release date: 2012-05-15)
footnote Full support
Edge – Full support
Edge 14 (Release date: 2016-08-02)
footnote Full support
Firefox – Full support
Firefox 78 (Release date: 2020-06-30)
footnote
footnote Supported by the sync storage area from Firefox 78.
footnote Supported by the session storage area from Firefox 131.
footnote Supported by the local and managed storage areas from Firefox 144.
Opera – Full support
Opera 33 (Release date: 2015-10-27)
footnote Full support
Safari – Full support
Safari 14 (Release date: 2020-09-16)
footnote Full support
Firefox for Android – Full support
Firefox for Android 79 (Release date: 2020-07-28)
footnote
footnote Supported by the sync storage area from Firefox for Android 79.
footnote Supported by the session storage area from Firefox for Android 131.
footnote Supported by the local and managed storage areas from Firefox for Android 144.
Safari on iOS – Full support
Safari on iOS 15 (Release date: 2021-09-20)
footnote Full support
getKeys
Chrome – Full support
Chrome 130 (Release date: 2024-10-15)
footnote Full support
Edge – Full support
Edge 130 (Release date: 2024-10-17)
footnote Full support
Firefox – Full support
Firefox 143 (Release date: 2025-09-16)
footnote Full support
Opera – Full support
Opera 115 (Release date: 2024-11-27)
footnote Full support
Safari – Full support
Safari 18.4 (Release date: 2025-03-31)
footnote Full support
Firefox for Android – Full support
Firefox for Android 143 (Release date: 2025-09-16)
footnote
footnote Doesn't support the managed storage area.
footnote Data isn't synchronized with the user's Mozilla account in the sync storage area. See bug 1625257
Safari on iOS – Full support
Safari on iOS 18.4 (Release date: 2025-03-31)
footnote Full support
onChanged
Chrome – Full support
Chrome 73 (Release date: 2019-03-12)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – Full support
Firefox 101 (Release date: 2022-05-31)
footnote Full support
Opera – Full support
Opera 60 (Release date: 2019-04-09)
footnote Full support
Safari – Full support
Safari 14 (Release date: 2020-09-16)
footnote Full support
Firefox for Android – Full support
Firefox for Android 101 (Release date: 2022-05-31)
footnote Full support
Safari on iOS – Full support
Safari on iOS 15 (Release date: 2021-09-20)
footnote Full support
remove
Chrome – Full support
Chrome 19 (Release date: 2012-05-15)
footnote Full support
Edge – Full support
Edge 14 (Release date: 2016-08-02)
footnote Full support
Firefox – Full support
Firefox 45 (Release date: 2016-03-08)
footnote Full support
Opera – Full support
Opera 33 (Release date: 2015-10-27)
footnote Full support
Safari – Full support
Safari 14 (Release date: 2020-09-16)
footnote Full support
Firefox for Android – Full support
Firefox for Android 48 (Release date: 2016-08-02)
footnote
footnote Doesn't support the managed storage area.
footnote Data isn't synchronized with the user's Mozilla account in the sync storage area. See bug 1625257
Safari on iOS – Full support
Safari on iOS 15 (Release date: 2021-09-20)
footnote Full support
Supports empty key
Chrome – Full support
Chrome 19 (Release date: 2012-05-15)
footnote Full support
Edge – Full support
Edge 14 (Release date: 2016-08-02)
footnote Full support
Firefox – Full support
Firefox 45 (Release date: 2016-03-08)
footnote Full support
Opera – Full support
Opera 33 (Release date: 2015-10-27)
footnote Full support
Safari – Full support
Safari 18 (Release date: 2024-09-16)
footnote Full support
Firefox for Android – Full support
Firefox for Android 48 (Release date: 2016-08-02)
footnote Full support
Safari on iOS – Full support
Safari on iOS 18 (Release date: 2024-09-16)
footnote Full support
set
Chrome – Full support
Chrome 19 (Release date: 2012-05-15)
footnote Full support
Edge – Full support
Edge 14 (Release date: 2016-08-02)
footnote
footnote storage is limited to 1MB per value.
Firefox – Full support
Firefox 45 (Release date: 2016-03-08)
footnote Full support
Opera – Full support
Opera 33 (Release date: 2015-10-27)
footnote Full support
Safari – Full support
Safari 14 (Release date: 2020-09-16)
footnote Full support
Firefox for Android – Full support
Firefox for Android 48 (Release date: 2016-08-02)
footnote
footnote Doesn't support the managed storage area.
footnote Data isn't synchronized with the user's Mozilla account and the storage quota limits are not enforced in the sync storage area. See bug 1625257
Safari on iOS – Full support
Safari on iOS 15 (Release date: 2021-09-20)
footnote Full support
setAccessLevel
Chrome – Full support
Chrome 96 (Release date: 2021-11-15)
footnote
footnote Supported by the session storage area from Chrome 96.
footnote Supported by all storage areas from Chrome 140.
Edge – Full support
Edge 96 (Release date: 2021-11-19)
footnote
footnote Supported by the session storage area from Edge 96.
footnote Supported by all storage areas from Edge 140.
Firefox – No support
Firefox
footnote
footnote See bug 1724754
Opera – Full support
Opera 82 (Release date: 2021-12-02)
footnote
footnote Supported by the session storage area from Opera 82.
footnote Supported by all storage areas from Opera 124.
Safari – Full support
Safari 17.1 (Release date: 2023-10-25)
footnote
footnote Only supported for the session storage area.
Firefox for Android – No support
Firefox for Android
footnote
footnote See bug 1724754
Safari on iOS – Full support
Safari on iOS 17.1 (Release date: 2023-10-25)
footnote
footnote Only supported for the session storage area.

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.