I'm currently developing an add-on that will display a panel with checkboxes and a save button when a toolbar button is clicked. The goal is to allow users to select checkboxes, then save the selected data in a JSON file that can be accessed and updated even after restarting the browser. The main question I have is whether the JSON file should be saved in the file system or local storage. Any guidance on this issue would be greatly appreciated! Please let me know if you need more information. Below is the addonScript I am using:
var self = require('sdk/self');
var data = require("sdk/self").data;
var text_entry = require("sdk/panel").Panel({
contentURL: data.url("CheckboxAddon.html"),
//contentScriptFile: data.url("my-script.js")
});
// Create a button to show the panel
require("sdk/ui/button/action").ActionButton({
id: "show-panel",
label: "Show Panel",
icon: {
"16": "./star-icon.png",
},
onClick: handleClick
});
// Show the panel when the user clicks the button.
function handleClick(state) {
text_entry.show();
}
text_entry.on("show", function() {
text_entry.port.emit("show");
});
text_entry.port.on("text-entered", function (text) {
console.log(text);
text_entry.hide();
});