// storage contains two items, "kitten" and "monster"
browser.storage.local.set({
kitten: { name: "Mog", eats: "mice" },
monster: { name: "Kraken", eats: "people" },
});StorageArea.getKeys() / notebook
StorageArea.getKeys()
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
browser.storage.local
.getKeys()
.then((keys) => console.log(keys)) // [ "kitten", "monster" ]
.catch((err) => console.error(`Error: ${err}`));