[wp-trac] [WordPress Trac] #33349: Synchronous XMLHttpRequest on the main thread is deprecated

WordPress Trac noreply at wordpress.org
Wed Jul 27 15:28:46 UTC 2016


#33349: Synchronous XMLHttpRequest on the main thread is deprecated
-------------------------------------+-----------------------------
 Reporter:  atomicjack               |       Owner:
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  Future Release
Component:  Administration           |     Version:  4.3
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:  javascript
-------------------------------------+-----------------------------

Comment (by iseulde):

 Uploaded a new patch that makes use of the Beacon API instead. The browser
 may also ignore the request if `async` is set to true and the page is
 already unloading, see https://developer.mozilla.org/en-
 US/docs/Web/API/Navigator/sendBeacon:

 > User agents will typically ignore asynchronous XMLHttpRequests made in
 an unload handler. To solve this problem, analytics and diagnostics code
 will typically make a synchronous XMLHttpRequest in an unload or
 beforeunload handler to submit the data. The synchronous XMLHttpRequest
 forces the User Agent to delay unloading the document, and makes the next
 navigation appear to be slower. There is nothing the next page can do to
 avoid this perception of poor page load performance.

 More info on #37487.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33349#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list