Merge "Avoid fatal errors with uselang=s"
[lhc/web/wiklou.git] / resources / startup.js
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 */
6
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://jquery.com/browser-support/
16 */
17
18 /*jshint unused: false */
19 function isCompatible( ua ) {
20 if ( ua === undefined ) {
21 ua = navigator.userAgent;
22 }
23
24 // MediaWiki JS or jQuery is known to have issues with:
25 return !(
26 // Internet Explorer < 6
27 ( ua.indexOf( 'MSIE' ) !== -1 && parseFloat( ua.split( 'MSIE' )[1] ) < 6 ) ||
28 // Firefox < 4
29 ( ua.indexOf( 'Firefox/' ) !== -1 && parseFloat( ua.split( 'Firefox/' )[1] ) < 4 )
30 );
31 }
32
33 /**
34 * The startUp() function will be auto-generated and added below.
35 */