Skip to content

Commit

Permalink
Tests: Skip the "jQuery.ajax() on unload" test in Safari
Browse files Browse the repository at this point in the history
The test has been already skipped in Chrome as it dropped support for such
requests and now Safari has joined the squad.

This will resolve AJAX test errors we've had for a while in Safari 13 & iOS 13.

Closes gh-4779

(cherry picked from commit c18dc49)
  • Loading branch information
mgol committed Sep 2, 2020
1 parent 2bf9793 commit 4f016c6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/unit/ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -2178,7 +2178,10 @@ if ( typeof window.ArrayBuffer === "undefined" || typeof new XMLHttpRequest().re
// Chrome 78 dropped support for synchronous XHR requests inside of
// beforeunload, unload, pagehide, and visibilitychange event handlers.
// See https://bugs.chromium.org/p/chromium/issues/detail?id=952452
if ( !/chrome/i.test( navigator.userAgent ) ) {
// Safari 13 did similar changes. The below check will catch them both.
// Edge Legacy fakes Chrome which fakes Safari in their user agents so we need
// to exclude Edge specifically here so that the test continues to run there.
if ( !/safari/i.test( navigator.userAgent ) || /edge\//i.test( navigator.userAgent ) ) {
testIframe(
"#14379 - jQuery.ajax() on unload",
"ajax/onunload.html",
Expand Down

0 comments on commit 4f016c6

Please sign in to comment.