X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=resources%2Fsrc%2Fstartup.js;h=deb280a8f18b8161434c64faa5ea1847b76d4a29;hb=692bf795a991ba2041eba086150cf87403e37fe0;hp=82a00bc6e550765aec020ffb922877aa4d0b90e0;hpb=82dff2f46c95d527de8a1fd32961c22832eb5444;p=lhc%2Fweb%2Fwiklou.git diff --git a/resources/src/startup.js b/resources/src/startup.js index 82a00bc6e5..deb280a8f1 100644 --- a/resources/src/startup.js +++ b/resources/src/startup.js @@ -6,11 +6,19 @@ /* global mw, $VARS, $CODE */ -// eslint-disable-next-line no-unused-vars -var mediaWikiLoadStart = ( new Date() ).getTime(), - mwPerformance = ( window.performance && performance.mark ) ? performance : { +var mwPerformance = ( window.performance && performance.mark ) ? performance : { mark: function () {} - }; + }, + // Define now() here to ensure valid comparison with mediaWikiLoadEnd (T153819). + mwNow = ( function () { + var perf = window.performance, + navStart = perf && perf.timing && perf.timing.navigationStart; + return navStart && typeof perf.now === 'function' ? + function () { return navStart + perf.now(); } : + function () { return +new Date(); }; + }() ), + // eslint-disable-next-line no-unused-vars + mediaWikiLoadStart = mwNow(); mwPerformance.mark( 'mwLoadStart' ); @@ -75,7 +83,7 @@ function isCompatible( str ) { // support in the modern run-time. // Note: Please extend the regex instead of adding new ones !( - ua.match( /webOS\/1\.[0-4]|SymbianOS|Series60|NetFront|Opera Mini|S40OviBrowser|MeeGo|Android.+Glass|^Mozilla\/5\.0 .+ Gecko\/$/ ) || + ua.match( /webOS\/1\.[0-4]|SymbianOS|Series60|NetFront|Opera Mini|S40OviBrowser|MeeGo|Android.+Glass|^Mozilla\/5\.0 .+ Gecko\/$|googleweblight/ ) || ua.match( /PlayStation/i ) ) );