Language: s/error_log/wfWarn/
[lhc/web/wiklou.git] / resources / src / startup.js
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 */
6
7 var mediaWikiLoadStart = ( new Date() ).getTime();
8
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 */
20
21 /*jshint unused: false */
22 function isCompatible( ua ) {
23 if ( ua === undefined ) {
24 ua = navigator.userAgent;
25 }
26
27 // Browsers with outdated or limited JavaScript engines get the no-JS experience
28 return !(
29 // Internet Explorer < 7
30 ( ua.indexOf( 'MSIE' ) !== -1 && parseFloat( ua.split( 'MSIE' )[1] ) < 7 ) ||
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 );
50 }
51
52 /**
53 * The startUp() function will be auto-generated and added below.
54 */