Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Tests: Blacklist beforeunload test in iOS

iOS has the window.onbeforeunload field but doesn't support the beforeunload
handler making it impossible to feature-detect the support.

Fixes #14717
Closes gh-1496
  • Loading branch information...
commit 988d99ad278c2c9dc16c68f86bddc4df99dcd928 1 parent d41fc68
@mzgol mzgol authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 test/unit/event.js
View
5 test/unit/event.js
@@ -1385,7 +1385,10 @@ test("Submit event can be stopped (#11049)", function() {
});
// Test beforeunload event only if it supported (i.e. not Opera)
-if ( window.onbeforeunload === null ) {
+// Support: iOS 7+
+// iOS has the window.onbeforeunload field but doesn't support the beforeunload
+// handler making it impossible to feature-detect the support.
+if ( window.onbeforeunload === null && !/(ipad|iphone|ipod)/i.test( navigator.userAgent ) ) {
asyncTest("on(beforeunload)", 1, function() {
var iframe = jQuery(jQuery.parseHTML("<iframe src='data/event/onbeforeunload.html'><iframe>"));
Please sign in to comment.
Something went wrong with that request. Please try again.