Skip to content

Commit 4f016c6

Browse files
committed
Tests: Skip the "jQuery.ajax() on unload" test in Safari
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 jquerygh-4779 (cherry picked from commit c18dc49)
1 parent 2bf9793 commit 4f016c6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/unit/ajax.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2178,7 +2178,10 @@ if ( typeof window.ArrayBuffer === "undefined" || typeof new XMLHttpRequest().re
21782178
// Chrome 78 dropped support for synchronous XHR requests inside of
21792179
// beforeunload, unload, pagehide, and visibilitychange event handlers.
21802180
// See https://bugs.chromium.org/p/chromium/issues/detail?id=952452
2181-
if ( !/chrome/i.test( navigator.userAgent ) ) {
2181+
// Safari 13 did similar changes. The below check will catch them both.
2182+
// Edge Legacy fakes Chrome which fakes Safari in their user agents so we need
2183+
// to exclude Edge specifically here so that the test continues to run there.
2184+
if ( !/safari/i.test( navigator.userAgent ) || /edge\//i.test( navigator.userAgent ) ) {
21822185
testIframe(
21832186
"#14379 - jQuery.ajax() on unload",
21842187
"ajax/onunload.html",

0 commit comments

Comments
 (0)