aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/ajax.js
diff options
context:
space:
mode:
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>2020-09-02 18:04:44 +0200
committerMichał Gołębiowski-Owczarek <m.goleb@gmail.com>2020-09-02 18:05:47 +0200
commit4f016c642cb7521d5df7e35058975353b58095fc (patch)
tree0b09b0e06e23e8046eabcc3d6a86308c944e64fe /test/unit/ajax.js
parent2bf9793efc9ff6ab5370119673744e9b43e3b872 (diff)
downloadjquery-4f016c642cb7521d5df7e35058975353b58095fc.tar.gz
jquery-4f016c642cb7521d5df7e35058975353b58095fc.zip
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 gh-4779 (cherry picked from commit c18dc49699bc27481a4af36ed1a0ee1b19c6eb03)
Diffstat (limited to 'test/unit/ajax.js')
-rw-r--r--test/unit/ajax.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/unit/ajax.js b/test/unit/ajax.js
index 9582018e7..3f301f18f 100644
--- a/test/unit/ajax.js
+++ b/test/unit/ajax.js
@@ -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",