From: Michał Gołębiowski Date: Thu, 23 Jan 2014 04:43:58 +0000 (+0100) Subject: Tests: Blacklist beforeunload test in iOS X-Git-Tag: 2.1.1-beta1~62 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=988d99ad278c2c9dc16c68f86bddc4df99dcd928;p=jquery.git 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 --- diff --git a/test/unit/event.js b/test/unit/event.js index 334dc6b1c..a04135f26 100644 --- a/test/unit/event.js +++ b/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("