From 988d99ad278c2c9dc16c68f86bddc4df99dcd928 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski?= Date: Thu, 23 Jan 2014 05:43:58 +0100 Subject: [PATCH] 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 --- test/unit/event.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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("