var mediaWikiLoadStart = ( new Date() ).getTime();
+if ( !window.performance ) {
+ window.performance = {};
+}
+if ( !performance.mark ) {
+ performance.mark = function () {};
+}
+performance.mark( 'mediaWikiStartUp' );
+
/**
* Returns false for Grade C supported browsers.
*
* - https://jquery.com/browser-support/
*/
-/*jshint unused: false */
+/*jshint unused: false, evil: true */
+/*globals mw, $VARS, $CODE */
function isCompatible( ua ) {
if ( ua === undefined ) {
ua = navigator.userAgent;
ua.match( /Opera Mini/ ) ||
// Nokia's Ovi Browser
ua.match( /S40OviBrowser/ ) ||
+ // MeeGo's browser
+ ua.match( /MeeGo/ ) ||
// Google Glass browser groks JS but UI is too limited
( ua.match( /Glass/ ) && ua.match( /Android/ ) )
);
}
/**
- * The startUp() function will be auto-generated and added below.
+ * The $CODE and $VARS placeholders are substituted in ResourceLoaderStartUpModule.php.
*/
+function startUp() {
+ mw.config = new mw.Map( $VARS.wgLegacyJavaScriptGlobals );
+
+ $CODE.registrations();
+
+ mw.config.set( $VARS.configuration );
+}
+
+// Conditional script injection
+if ( isCompatible() ) {
+ document.write( $VARS.baseModulesScript );
+}