The procedure for provisioning managed storage varies between browsers. For Chrome instructions, see the "Manifest for storage areas" article.
For Firefox, you need to create a JSON manifest file in a specific format and location. For the details of manifest syntax and location, see Native manifests.
Here's an example manifest:
{
"name": "[email protected]",
"description": "ignored",
"type": "storage",
"data": {
"colour": "management thinks it should be blue!"
}
}
Given this manifest, the favourite-colour extension could access the data using code like this:
let storageItem = browser.storage.managed.get('colour');
storageItem.then((res) => {
console.log(`Managed colour is: ${res.colour}`);
});