Motivation
Now we can use chrome.runtime.onInstalled.addListener, but it has some inconvenience.
If the event listener is not attached in the first event loop, it will miss the event.
Proposal
browser.runtime.isFirstInstalled: boolean (OnInstalledReason = install)
browser.runtime.updatedFrom: string | undefined (OnInstalledReason = update)
With these new properties, the extension will less likely to miss the onInstalled event.
Motivation
Now we can use
chrome.runtime.onInstalled.addListener, but it has some inconvenience.If the event listener is not attached in the first event loop, it will miss the event.
Proposal
browser.runtime.isFirstInstalled: boolean(OnInstalledReason = install)browser.runtime.updatedFrom: string | undefined(OnInstalledReason = update)With these new properties, the extension will less likely to miss the onInstalled event.