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