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();
10 * Returns false for Grade C supported browsers.
12 * This function should only be used by the Startup module, do not expand it to
13 * be generally useful beyond startup.
16 * - https://www.mediawiki.org/wiki/Compatibility#Browsers
17 * - https://jquery.com/browser-support/
20 /*jshint unused: false */
21 function isCompatible( ua ) {
22 if ( ua === undefined ) {
23 ua = navigator.userAgent;
26 // Browsers with outdated or limited JavaScript engines get the no-JS experience
28 // Internet Explorer < 8
29 ( ua.indexOf( 'MSIE' ) !== -1 && parseFloat( ua.split( 'MSIE' )[1] ) < 8 ) ||
31 ( ua.indexOf( 'Firefox/' ) !== -1 && parseFloat( ua.split( 'Firefox/' )[1] ) < 3 ) ||
33 ( ua.indexOf( 'Opera/' ) !== -1 && ( ua.indexOf( 'Version/' ) === -1 ?
35 parseFloat( ua.split( 'Opera/' )[1] ) < 10 :
36 // "Opera/9.80 ... Version/x.y"
37 parseFloat( ua.split( 'Version/' )[1] ) < 12
39 // "Mozilla/0.0 ... Opera x.y"
40 ( ua.indexOf( 'Opera ' ) !== -1 && parseFloat( ua.split( ' Opera ' )[1] ) < 10 ) ||
42 ua.match( /BlackBerry[^\/]*\/[1-5]\./ ) ||
44 ua.match( /webOS\/1\.[0-4]/ ) ||
45 // Anything PlayStation based.
46 ua.match( /PlayStation/i ) ||
47 // Any Symbian based browsers
48 ua.match( /SymbianOS|Series60/ ) ||
49 // Any NetFront based browser
50 ua.match( /NetFront/ ) ||
51 // Opera Mini, all versions
52 ua.match( /Opera Mini/ ) ||
53 // Nokia's Ovi Browser
54 ua.match( /S40OviBrowser/ ) ||
55 // Google Glass browser groks JS but UI is too limited
56 ( ua.match( /Glass/ ) && ua.match( /Android/ ) )
61 * The startUp() function will be auto-generated and added below.