sync storage area. Items in
sync storage are synced by the browser, and are available across all instances of that browser that the user is logged into (e.g. via Firefox sync, or a Google account), across different devices.
For Firefox a user must have
Add-ons checked under the "Sync Settings" options in
Note that the implementation of
storage.sync in Firefox relies on the Add-on ID. If you use
storage.sync, you must set an ID for your extension using the
browser_specific_settings manifest.json key.
The main use case of this API is to store preferences about your extension and allow the user to sync them to different profiles.
The browser enforces limits on the amount of data each extension is allowed to store in the sync area:
|Name||Description||Value in bytes|
|Maximum total size||The maximum total amount of data that each extension is allowed to store in the sync storage area, as measured by the JSON stringification of every value plus every key's length.||102400|
|Maximum item size||The maximum size of any one item that each extension is allowed to store in the sync storage area, as measured by the JSON stringification of the item's value plus the length of its key.||8192|
|Maximum number of items||The maximum number of items that each extension is allowed to store in the sync storage area.||
If an extension attempts to store items that exceed these limits, the call to
storage.sync.set() will be rejected with an error. An extension can use
storage.sync.getBytesInUse() to find out how much of its maximum total quota it is currently using.
sync object implements the methods defined on the
Retrieves one or more items from the storage area.
Gets the amount of storage space (in bytes) used one or more items being stored in the storage area.
Stores one or more items in the storage area. If the item already exists, its value will be updated.
Removes one or more items from the storage area.
Removes all items from the storage area.
BCD tables only load in the browser