Closed polywock closed 6 months ago
This proposal can supersede #353 (runtime.onEnabled) and the existing runtime.onInstalled if this event receives their params (reason, previousVersion, etc.) with "enabled"
added to the enum of reasons.
This proposal is the same as proposal #353 just with a different name. runtime.onSessionStart
, runtime.onExtensionStartup
or runtime.onExtensionLoaded
are the same thing just different names. Chrome is supportive of both this event and onEnabled
https://github.com/w3c/webextensions/issues/353#issuecomment-1593591201 , other browsers are supportive too.
Great, that's exactly it.
If an extension needs to initialize by moving some storage items from local storage into session storage. There's no single event that can be used to do that.
You would have to use both onInstalled and onStartup. This has a few issues.
Proposal
browser.runtime.onSessionStart
event that is fired when the extension's session starts.Relevant memo.
https://github.com/w3c/webextensions/blob/main/memo/persistence-of-states.md#definitions