Repository navigation
fix(api): remove outdated Firefox beforeunload bfcache claims - #46218
Merged
hamishwillee merged 5 commits intoOct 25, 2026
Merged
Conversation
BaconMan1168
requested review from
hamishwillee
and removed request for
a team
October 21, 2026 00:25
Contributor
|
Preview URLs (3 pages)
External URLs (2)URL:
URL:
(comment last updated: 2026-10-25 22:38:49) |
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
| - Only show a generic browser-specified string in the displayed dialog. This cannot be controlled by the webpage code. | ||
|
|
||
| The `beforeunload` event suffers from some problems: | ||
| The `beforeunload` event is not reliably fired, especially on mobile platforms. For example, the event is not fired in the following scenario: |
Contributor
There was a problem hiding this comment.
[mdn-linter] reported by reviewdog 🐶
Suggested change
| The `beforeunload` event is not reliably fired, especially on mobile platforms. For example, the event is not fired in the following scenario: | |
| The `beforeunload` event is not reliably fired, especially on mobile platforms. For example, the event is not fired in the following scenario: |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
wbamberg
added a commit
to wbamberg/content
that referenced
this pull request
Oct 26, 2026
* origin/fix-42136: Update clipboard docs for Chrome 157 service worker support (mdn#46202) FF159 Relnote: WebGL EXT_clip_control, EXT_texture_mirror_clamp_to_edge, EXT_texture_norm16 (mdn#46262) Update Firefox 159 release notes for WebDriver conforming changes (mdn#46265) Move `core-js` links to website docs (mdn#46259) BigInt.asIntN: Fix comment to reflect actual I64_CEIL value (mdn#46255) Container Timing API (mdn#45564) fix(api): remove outdated Firefox beforeunload bfcache claims (mdn#46218) Fix numbers of `<rect>` elements in examples (mdn#46256) Add missing `PlatformArch` values (mdn#43847) Update InterfaceData based on WebRef (mdn#46254) Fix memory management code sample and comment wording (mdn#46252)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR removes the claim that Firefox won't put pages with
beforeunloadlisteners in the bfcache, along with the same claim on thesendBeacon()andpagehidepages.Motivation
beforeunloadusage notes said Firefox excludes pages withbeforeunloadlisteners from the bfcache. Firefox has allowed these pages in the bfcache since version 116, so I removed the bullet. That left a one-item list, so I turned it into a paragraph. I also removed the sentence saying that listening sparingly minimizes the effect on performance, since the removed bullet was the only reason given for it.sendBeacon()page had a separate line saying Firefox excludes pages withbeforeunloadhandlers, which I removed. The comparison withpagehidenow only mentionsunload.pagehidepage saidpagehideis compatible with the bfcache "unlike theunloadandbeforeunloadevents". It now only mentionsunload.Additional details
docshell.shistory.bfcache.ship_allow_beforeunload_listenerspref now defaults totrueon all platforms in Firefox's current source.markdownlint-cli2andprettier --checkreport 0 issues on the changed files, and the front-matter linter passes.Related issues and pull requests
Fixes #46214