-2

I am developing extension and I want to read and change local JSON file in extension file directory.

How to make this?

Ekin
  • 107
  • 1
  • 9

1 Answers1

-2

I don't know if you can store data in a JSON file, but you can always use localStorage. If you set the localStorage, the data will not disappear every time you open the extension popup.

let data = JSON.parse(localStorage.data ?? "{}");
data.say = "hello world";
localStorage.data = JSON.stringify(data);