A while ago, I ported my extension from Firefox to Chrome. With MV3 just around the corner, I want to start migrating my extension from MV2 to MV3. It's been a bit of a learning curve, mainly because background scripts are replaced by service workers, which I am not familiar with.
Previously, when I wanted a function to run when the extension is started up (either for first install or when the browser is started), I could just put the function call in the background script and it would run, since background scripts are persistent.
For what I can tell, doing that with a service worker will cause the function to run each time the service workers starts again, after having been terminated because it was idle. That's obviously not what I want to happen.
Do I need to register onInstall and onStartup listeners to trigger the function?