Chrome now disallows synchronous XHR during page dismissal when the page is being navigated away from or closed by the user. This involves the following events (when fired on the path of page dismissal): beforeunload, unload, pagehide, and visibilitychange. A temporary opt-out is available via Origin Trial "Allow Sync XHR In Page Dismissal":


Synchronous XHR is on the deprecation path. It hurts the end user experience. beforeunload and unload are used by third parties and first parties to send analytics data to servers. While this is reasonable, there are no good reasons to use synchronous XHR. Instead SendBeacon, Fetch keep-alive should be used (in addition to sending analytics periodically and on pagevisibility etc.). Page dismissal is also an interesting scenario for the following reasons: 1. It hurts the user experience when the user is trying to leave the page or navigate (up to a max timeout of 1s, which is 2s in practice in chrome) 2. The intention of beforeunload handler is a mechanism for preventing data loss for users, however it is used by third parties as a way to reliably do a bunch of work (including sync xhr), up to the max timeout. Some relevant data in this slide deck. This hurts the end user experience. 3. As part of Page Lifecycle API: we want to experiment with running the beforeunload handler at the time of freezing (to determine risk of data loss) to support proactive tab discarding. And Sync XHR (and large amount of work) is problematic here. For now, enterprise users can use the AllowSyncXHRInPageDismissal policy flag and developers can opt into the AllowSyncXHRInPageDismissal origin trial to allow synchronous XHR requests during page unload. We expect to remove this flag in Chrome 93.

Status in Chromium


Enabled by default (tracking bug)

Consensus & Standardization

After a feature ships in Chrome, the values listed here are not guaranteed to be up to date.

  • No signal
  • No signal
  • No signals


Intent to Prototype url

Intent to Prototype thread


A temporary opt-out is available via Origin Trial "Allow Sync XHR In Page Dismissal":

Last updated on 2021-12-13