XHR load, loadend, readystatechange events are now deferred during page load

Published: | Categories: DOM, Networking

Description

Starting with Firefox 68, final events for XMLHttpRequest started during page load will be deferred until an idle time is available or the loading is complete. These events include load, loadend and readystatechange fired once the readyState property becomes 4.

Just like a similar change made to setTimeout() with Firefox 66, this change aims at improving the performance of complex web applications like Gmail, but unexpected race conditions could occur if the initialization code is not designed properly.

Update: Firefox 69 has made a similar change to fetch() as well.

References