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.
7 var mediaWikiLoadStart
= ( new Date() ).getTime();
9 if ( !window
.performance
) {
10 window
.performance
= {};
12 if ( !performance
.mark
) {
13 performance
.mark = function () {};
15 performance
.mark( 'mediaWikiStartUp' );
18 * Returns false for Grade C supported browsers.
20 * This function should only be used by the Startup module, do not expand it to
21 * be generally useful beyond startup.
24 * - https://www.mediawiki.org/wiki/Compatibility#Browsers
25 * - https://jquery.com/browser-support/
28 /*jshint unused: false */
29 function isCompatible( ua
) {
30 if ( ua
=== undefined ) {
31 ua
= navigator
.userAgent
;
34 // Browsers with outdated or limited JavaScript engines get the no-JS experience
36 // Internet Explorer < 8
37 ( ua
.indexOf( 'MSIE' ) !== -1 && parseFloat( ua
.split( 'MSIE' )[1] ) < 8 ) ||
39 ( ua
.indexOf( 'Firefox/' ) !== -1 && parseFloat( ua
.split( 'Firefox/' )[1] ) < 3 ) ||
41 ( ua
.indexOf( 'Opera/' ) !== -1 && ( ua
.indexOf( 'Version/' ) === -1 ?
43 parseFloat( ua
.split( 'Opera/' )[1] ) < 10 :
44 // "Opera/9.80 ... Version/x.y"
45 parseFloat( ua
.split( 'Version/' )[1] ) < 12
47 // "Mozilla/0.0 ... Opera x.y"
48 ( ua
.indexOf( 'Opera ' ) !== -1 && parseFloat( ua
.split( ' Opera ' )[1] ) < 10 ) ||
50 ua
.match( /BlackBerry[^\/]*\/[1-5]\./ ) ||
52 ua
.match( /webOS\/1\.[0-4]/ ) ||
53 // Anything PlayStation based.
54 ua
.match( /PlayStation/i ) ||
55 // Any Symbian based browsers
56 ua
.match( /SymbianOS|Series60/ ) ||
57 // Any NetFront based browser
58 ua
.match( /NetFront/ ) ||
59 // Opera Mini, all versions
60 ua
.match( /Opera Mini/ ) ||
61 // Nokia's Ovi Browser
62 ua
.match( /S40OviBrowser/ ) ||
64 ua
.match( /MeeGo/ ) ||
65 // Google Glass browser groks JS but UI is too limited
66 ( ua
.match( /Glass/ ) && ua
.match( /Android/ ) )
71 * The startUp() function will be auto-generated and added below.