Hi Simeon and thank you for your reply.
I actually deleted the thread after realizing that the old MV2 version of my extension had NOT placed the “onInstalled” event handler in the right place.
I put this event handler inside the DOMContentloaded event handler instead of in the main code flow.
Also, I design my MV2 background script to be not persistent, so it was flushed after 20-30 seconds.
By updating to first MV3 version (which instead has the “onInstalled” event handler placed in the right place) the event WAS NOT triggered either as an "update" or as an "first installation".
This made me think a bit ....
I mean, if I update the extension when the MV2 background is already "gone", I can therefore expect that no listener is listening to nothing (especially when that listener has not been properly installed), but I would expect the newly MV3 listener hears either an "update" or a "first install" event.
At that point, to have some king of verification, I created a third MV3 version (same code with an higher version number) and I dragged\updated again upon the previous MV3 version.
This time the onInstalled event was honored successfully.
A question (perhaps stupid) at this point arises in my head:
"At the time of the update which onInstalled handler is executed? The one of the old version or the one referring to the new one?"
Help me to do some 'clarity, please.
Anyway now I've fixed it.
When I will be ready to migrate to the store I will need to make sure this important event is honored
so my script will be able to copy the variables previously stored in localStorage in chrome.storage.local
If I didn't do this kind of job then my extension will obviously stop working.
Thanks