docs.rodeo

MDN Web Docs mirror

storage

{{AddonSidebar}} 

Enables extensions to store and retrieve data, and listen for changes to stored items.

The storage system is based on the Web Storage API, with a few differences. Among other differences, these include:

To use this API you need to include the "storage" permission in your manifest.json file.

Each extension has its own storage area, which can be split into different types of storage.

Although this API is similar to {{domxref("Window.localStorage")}}  it is recommended that you don’t use Window.localStorage in the extension code to store extension-related data. Firefox will clear data stored by extensions using the localStorage API in various scenarios where users clear their browsing history and data for privacy reasons, while data saved using the storage.local API will be correctly persisted in these scenarios.

You can examine the stored data under the Extension Storage item in the Storage Inspector tab of the developer toolbox, accessible from about:debugging.

[!NOTE] The storage area is not encrypted and shouldn’t be used for storing confidential user information.

Types

Properties

storage has four properties, which represent the different types of available storage area.

Events

Browser compatibility

{{Compat}} 

{{WebExtExamples("h2")}} 

[!NOTE] This API is based on Chromium’s chrome.storage API. This documentation is derived from storage.json in the Chromium code.

In this article

View on MDN