Merge "resourceloader: Avoid clear/set timer overhead in mw.loader.store.add"
[lhc/web/wiklou.git] / resources / src / startup / startup.js
index b2d86e2..8c79c94 100644 (file)
@@ -4,7 +4,7 @@
  * - Beware: This file MUST parse without errors on even the most ancient of browsers!
  */
 /* eslint-disable vars-on-top, no-unmodified-loop-condition */
-/* global mw, isCompatible, $VARS, $CODE */
+/* global isCompatible, $VARS, $CODE */
 
 /**
  * See <https://www.mediawiki.org/wiki/Compatibility#Browsers>
@@ -55,7 +55,7 @@ window.isCompatible = function ( str ) {
                // https://caniuse.com/#feat=json / https://phabricator.wikimedia.org/T141344#2784065
                ( function () {
                        'use strict';
-                       return !this && !!Function.prototype.bind && !!window.JSON;
+                       return !this && Function.prototype.bind && window.JSON;
                }() ) &&
 
                // https://caniuse.com/#feat=queryselector
@@ -72,10 +72,7 @@ window.isCompatible = function ( str ) {
                // Hardcoded exceptions for browsers that pass the requirement but we don't want to
                // support in the modern run-time.
                // Note: Please extend the regex instead of adding new ones
-               !(
-                       ua.match( /MSIE 10|webOS\/1\.[0-4]|SymbianOS|Series60|NetFront|Opera Mini|S40OviBrowser|MeeGo|Android.+Glass|^Mozilla\/5\.0 .+ Gecko\/$|googleweblight/ ) ||
-                       ua.match( /PlayStation/i )
-               )
+               !ua.match( /MSIE 10|webOS\/1\.[0-4]|SymbianOS|Series60|NetFront|Opera Mini|S40OviBrowser|MeeGo|Android.+Glass|^Mozilla\/5\.0 .+ Gecko\/$|googleweblight|PLAYSTATION|PlayStation/ )
        );
 };
 
@@ -148,5 +145,5 @@ window.isCompatible = function ( str ) {
        // This embeds mediawiki.js, which defines 'mw' and 'mw.loader'.
        $CODE.defineLoader();
 
-       mw.requestIdleCallback( startUp );
+       startUp();
 }() );