The background scripts article has some advice on coding for non-persistence, but not quite enough. I have a few questions:
I’m not sure what the right event is for initializing code whenever the extension starts. At the moment I just use a bare
init()function in the background script. Is that fine?
My extension currently loads settings from storage at startup, which is then imported by various modules for their functions to refer to. Is the non-persistent way really having functions directly load relevant settings every time they are needed?
Is dynamically importing modules for optional functionality worth doing for performance?