I have a restartless firefox extension in which I have an array which is used for some decision making. The elements of this array can change overtime.
Currently I have my bootstrap.js
file which calls various functions present in another .js
files. And within one of these functions is this array.
I am trying to figure out how can I restructure my code in such a way that I can update this array (not entire extension) after installation.
What I have thought of is; to pull this array out into a separate .js
file and plan to swap this when I make the array 'update' after installation.
However, I still don't understand how to do it. The way I understand is, I bundle my add-on as an .xpi
it gets installed and then is it possible to do a partial upgrade?
I don't want to push another .xpi
for this. And I assume that will also make the user aware that the extension has updated. Since, the array updates can be frequent this can look really weird for the user updates happening every week or so.
Can I do this over an API that will fetch the updated array and swap it in the code ( Do .push
to existing array ) ? Basically, I want this to be invisible to the user and lightweight as well.
How can I do it in a better/correct way? If I am asking for something not presently possible let me know.