I want to store data (increasing everytime the extension is "triggered") in a json file to display it for the user. I can't find a solution on how to add a json file where I can store and overwrite data.
Asked
Active
Viewed 147 times
1
-
Usually the value is displayed in a normal html-based page. Why do you need JSON? – wOxxOm Dec 06 '22 at 18:59
1 Answers
1
To store persistent data between between uses, you'll need to use the "storage" API which you can read about here.
Basically, you'll want to include the storage API in your manifest, then call it with methods like let gettingAllStorageItems = browser.storage.local.get(null);
. Here's an example.

old_dd
- 135
- 2
- 13