# Stop opening the preferences page when firefox updates?

**URL:** <https://discourse.mozilla.org/t/stop-opening-the-preferences-page-when-firefox-updates/96064>\
**Category:** Development\
**Created:** [April 17, 2022, 12:42pm UTC](https://discourse.mozilla.org/t/stop-opening-the-preferences-page-when-firefox-updates/96064 "2022-04-17T12:42:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel04](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/daniel04/32/50953_2.png) [@Daniel04](https://discourse.mozilla.org/u/Daniel04)\
**Post date:** [April 17, 2022, 12:42pm UTC](https://discourse.mozilla.org/t/stop-opening-the-preferences-page-when-firefox-updates/96064/1 "2022-04-17T12:42:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![hans\_squared](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/hans_squared/32/67424_2.png) [@hans\_squared](https://discourse.mozilla.org/u/hans_squared)\
**Post date:** [April 17, 2022, 1:49pm UTC](https://discourse.mozilla.org/t/stop-opening-the-preferences-page-when-firefox-updates/96064/2 "2022-04-17T13:49:37Z")

</div>

> [@Daniel04](#):
>
> Is there a way to make sure this page **opens only when my addon updates and not the browser**?

> **[runtime.onInstalled - Mozilla | MDN](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/onInstalled#reason)**
>
> Fired when the extension is first installed, when the extension is updated to a new version, and when the browser is updated to a new version.

reason  
An [`runtime.OnInstalledReason`](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/OnInstalledReason) value, stating the reason that this event is being dispatched.

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

---

<div class="post-metadata">

**Author:** ![Daniel04](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/daniel04/32/50953_2.png) [@Daniel04](https://discourse.mozilla.org/u/Daniel04)\
**Post date:** [April 17, 2022, 2:39pm UTC](https://discourse.mozilla.org/t/stop-opening-the-preferences-page-when-firefox-updates/96064/3 "2022-04-17T14:39:19Z")

</div>

That was super helpful. Thank you!
