Stop opening the preferences page when firefox updates?

Hello folks, I am using the following API to open my addon’s preferences page whenever it gets installed for the 1st time or updates to a new version.

browser.runtime.onInstalled.addListener(onInstalledFunction);


Problem: Recently, firefox updated to a newer version and I found the page opening again. Is there a way to make sure this page opens only when my addon updates and not the browser?

Thank you,
Daniel.


reason
An runtime.OnInstalledReason value, stating the reason that this event is being dispatched.

There’s an example https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/onInstalled#examples

1 Like

That was super helpful. Thank you!