Each time I open my MV3 extension the javascript runs from the beginning, it’s not persistent. If I set some variable and then close the extension, when I open it again the value stored in the variable is gone.
I’m trying to keep a few variables in memory. I believe I can do something similar with chrome.store.session
, but that’s not available on Firefox, so what can I do?
Also keep in mind that the data I’m trying to get to be persistent could be sensitive, so I can’t just save it in local storage. It should be in memory while the browser is open and then get wiped.
To load the script from the manifest I’m using
"background": {
"page": "background.html"
}
where background.html
is a page that just loads the script. I’m doing it like this because it’s the only way I was able to get the script to load as a module.