Use of sync XHR during unload, pagehide events is now deprecated

Published: | Categories: DOM


Starting with Firefox 68, Web Console warns when a synchronous XMLHttpRequest is used in an unload or pagehide event listener, because it contributes to negative user experience. You can use the navigator.sendBeacon method instead, which is now available in all modern browsers.

Note that use of synchronous XMLHttpRequest outside of these events has been warned since Firefox 30. You may want to double-check your code to make sure all requests on the main thread are asynchronous.