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
});
// 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>"));