Open Bug 1854492 Opened 8 months ago Updated 8 months ago

pagehide event not raised when tab opened and closed in short time

Categories

(Core :: DOM: Events, defect)

Firefox 117
defect

Tracking

()

People

(Reporter: bugzilla, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/117.0

Steps to reproduce:

  1. Open a tab on a site which registers a pagehide listener
  2. Close tab with Ctrl-W
  3. Immediately reopen tab

Actual results:

The pagehide event is not fired.

Expected results:

A pagehide event should have been fired when the tab was closed

Some notes on reproducing this:

  • I encountered the problem at https://develop.element.io. On that site, if the pagehide handler is not called, then when the tab is reopened, you see "Element is open in another window".
  • I was unable to reproduce the problem with a minimal site. I don't know if this is because Element is doing something specific to trigger the problem, or if it's some sort of race which is hard to trigger with a lightweight site.
  • To observe the issue, I found it helpful to set the config setting devtools.console.stdout.content to true, to get console.log printed to stdout. Element logs when the pagehide handler is called.

The Bugbug bot thinks this bug should belong to the 'Firefox::Tabbed Browser' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Tabbed Browser

I've reproduced this issue in the latest versions Nightly 119.0a1 and Firefox 117.0.1 on Windows 10 x64 when using the second time the option "Reopen Closed Tab" thus:

Setting the component and waiting for the developer's opinion about it.
If this is not the correct component, please feel free to change it to a more appropriate one.

Severity: -- → S3
Status: UNCONFIRMED → NEW
Component: Tabbed Browser → DOM: Events
Ever confirmed: true
Product: Firefox → Core
You need to log in before you can comment on or make changes to this bug.