# onUserLeave not firing when Firefox users leave session by closing page

**URL:** <https://devforum.zoom.us/t/onuserleave-not-firing-when-firefox-users-leave-session-by-closing-page/132288>\
**Category:** React Native\
**Created:** [May 2, 2025, 10:32pm UTC](https://devforum.zoom.us/t/onuserleave-not-firing-when-firefox-users-leave-session-by-closing-page/132288 "2025-05-02T22:32:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jon-L](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon-l/32/55248_2.png) [@Jon-L](https://devforum.zoom.us/u/Jon-L)\
**Post date:** [May 2, 2025, 10:32pm UTC](https://devforum.zoom.us/t/onuserleave-not-firing-when-firefox-users-leave-session-by-closing-page/132288/1 "2025-05-02T22:32:16Z")

</div>

**Description**  
We have a Web Video SDK app and are developing a React Native Video SDK app to pair with it.

In the Web app, we have the client.init option leaveOnPageUnload set to true. When a user leaves a web app session by closing or refreshing the page, the user-removed Web SDK event is always sent to the other Web SDK clients in the session.

However, in the React Native app, the equivalent onUserLeave SDK event is inconsistent.

- If the Web SDK user who leaves is using a Chromium browser, the onUserLeave event fires.
- If the Web SDK user who leaves is using Firefox, the onUserLeave event does NOT fire.

**Errors**  
No errors are shown.

**Which React Native Video SDK version?**  
React Native: 1.13.12  
Web: 2.1.10

**Smartphone (please complete the following information):**

- Device: Samsung Galaxy S22+
- OS: 14.0

Please advise. Thank you.

---

<div class="post-metadata">

**Author:** ![ticorrian.heard](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ticorrian.heard/32/70213_2.png) [@ticorrian.heard](https://devforum.zoom.us/u/ticorrian.heard)\
**Post date:** [May 7, 2025, 3:15pm UTC](https://devforum.zoom.us/t/onuserleave-not-firing-when-firefox-users-leave-session-by-closing-page/132288/3 "2025-05-07T15:15:26Z")

</div>

Hey @Jon-L I can assist you with this. Are you seeing issues only on Firefox? Or is it any browser that is not Chromium?

---

<div class="post-metadata">

**Author:** ![Jon-L](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon-l/32/55248_2.png) [@Jon-L](https://devforum.zoom.us/u/Jon-L)\
**Post date:** [May 7, 2025, 8:15pm UTC](https://devforum.zoom.us/t/onuserleave-not-firing-when-firefox-users-leave-session-by-closing-page/132288/4 "2025-05-07T20:15:13Z")

</div>

Hi @ticorrian.heard, thank you for your assistance.

We tested this on Firefox, Safari, Edge, Chrome, Chromium, Brave, and Opera. Of this list, only Firefox has this issue.

We have tried this with Firefox 130.0.1 and 138.0.

Edit: I was incorrect in my original post, the web app’s user-removed event is _not_ firing when Firefox users leave by closing the window. So this must be an issue with the web app’s leaveOnPageUnload and not with the React Native SDK. Is this something you can still assist with or should I open a different thread in the Web SDK category?

---

<div class="post-metadata">

**Author:** ![vic.yang](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vic.yang/32/24656_2.png) [@vic.yang](https://devforum.zoom.us/u/vic.yang)\
**Post date:** [May 8, 2025, 7:49am UTC](https://devforum.zoom.us/t/onuserleave-not-firing-when-firefox-users-leave-session-by-closing-page/132288/5 "2025-05-08T07:49:22Z")

</div>

Hey @Jon-L

Thanks for your feedback.

> leaveOnPageUnload

This is currently a known issue on Firefox.

I’ll explain the reason in detail:

`leaveOnPageUnload` relies on listening to the `beforeunload` event on the window, and triggers the session leave inside the callback.

However, on Firefox, if the event’s `returnValue` is not empty or `preventDefault()` is not called, the callback may be skipped entirely. On the other hand, if `returnValue` is set, Firefox shows a confirmation popup when the page is closed or refreshed — which is not the intended behavior.

We also tried using the `visibilitychange` event, but it doesn’t reliably fulfill this functionality either.

So this remains a known limitation on Firefox.

> **[Window: beforeunload event - Web APIs | MDN](https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event)**
>
> The beforeunload event is fired when the current window, contained document, and associated resources are about to be unloaded. The document is still visible and the event is still cancelable at this point.

Thanks  
Vic

---

<div class="post-metadata">

**Author:** ![Jon-L](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon-l/32/55248_2.png) [@Jon-L](https://devforum.zoom.us/u/Jon-L)\
**Post date:** [May 8, 2025, 10:49pm UTC](https://devforum.zoom.us/t/onuserleave-not-firing-when-firefox-users-leave-session-by-closing-page/132288/6 "2025-05-08T22:49:10Z")

</div>

Appreciate the response, Vic! Good to know.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [May 8, 2026, 10:50pm UTC](https://devforum.zoom.us/t/onuserleave-not-firing-when-firefox-users-leave-session-by-closing-page/132288/7 "2026-05-08T22:50:11Z")

</div>

Closed on May 8, 2026, 10:50pm UTC

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
