I am building a simple extension that needs to save some basic data. However, the browser.storage is not working at all. Here is my code:
browser.storage.local.set({kitten: { name: “Mog”, eats: “mice” }})
.then(() => {
browser.storage.local.get([“kitten”])
.then(results => console.log(results))
}).catch(e => console.error(e))
It just prints this:
Am I using the functions wrong? How exactly can I save this data locally which can be used later?