Make sure we always restore the error handler.
[mediawiki.git] / resources / startup.js
blobb6a27d2d508df2b1d5675c2ebfe681765422b5e3
1 /**
2  * This script provides a function which is run to evaluate whether or not to
3  * continue loading the jquery and mediawiki modules. This code should work on
4  * even the most ancient of browsers, so be very careful when editing.
5  */
7 /**
8  * Returns false when run in a black-listed browser
9  *
10  * This function will be deleted after it's used, so do not expand it to be
11  * generally useful beyond startup.
12  *
13  * See also:
14  * - https://www.mediawiki.org/wiki/Compatibility#Browser
15  * - http://jquerymobile.com/gbs/
16  * - http://jquery.com/browser-support/
17  */
19 /*jshint unused: false */
20 function isCompatible( ua ) {
21         if ( ua === undefined ) {
22                 ua = navigator.userAgent;
23         }
25         // MediaWiki JS or jQuery is known to have issues with:
26         return !(
27                 // Internet Explorer < 6
28                 ( ua.indexOf( 'MSIE' ) !== -1 && parseFloat( ua.split( 'MSIE' )[1] ) < 6 ) ||
29                 // Firefox < 3
30                 ( ua.indexOf( 'Firefox/' ) !== -1 && parseFloat( ua.split( 'Firefox/' )[1] ) < 3 ) ||
31                 // BlackBerry < 6
32                 ua.match( /BlackBerry[^\/]*\/[1-5]\./ ) ||
33                 // Open WebOS < 1.5
34                 ua.match( /webOS\/1\.[0-4]/ ) ||
35                 // Anything PlayStation based.
36                 ua.match( /PlayStation/i ) ||
37                 // Any Symbian based browsers
38                 ua.match( /SymbianOS|Series60/ ) ||
39                 // Any NetFront based browser
40                 ua.match( /NetFront/ ) ||
41                 // Opera Mini, all versions
42                 ua.match( /Opera Mini/ ) ||
43                 // Nokia's Ovi Browser
44                 ua.match( /S40OviBrowser/ )
45         );
48 /**
49  * The startUp() function will be auto-generated and added below.
50  */