In background.js of my extension(mv3), I am doing following things: 1. created an alarm with periodInMinutes:1, 2. register alarm listener, 3. register chrome.downloads.onCreate listener to monitor file downloads, 4. connect to Native Messaging port. When I start chrome and wait a while, my extension turns to inactive status which is expected because it is not persistent. When I download something, the extension is invoked and background.js is executed again. My question is are those event listeners registered in first run still valid when background.js is invoked and executed again?
Do I have to implement a mechanism to avoid registering them again or it is correct to do all the things again?