Thanks @dotproto, this really helped solidify my mental model of a non-persistent/event-based environment.
Stuff like this should probably be made more explicit in the documentation. I had assumed that in an event-based system it’s somehow required (or at least ideal or optimal) to have all top-level execution be just event listeners.
So to drive the point home, any ephemeral data that doesn’t need to survive between environment lifetimes i.e. while the extension ‘sleeps’ (e.g. a report of current tabs) can be left in local variables, correct?
And is it also correct to say that what will persist between environment lifetimes are anything set up via extension APIs: menus, alarms, scripts, etc?