diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:12:12 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:12:12 -0400 |
commit | c9aa36da061816dee256a979c2ff8d2ee41824d9 (patch) | |
tree | 29f7002b80ee984b488bd047dbbd80b36bf892e9 /resources/src/startup.js | |
parent | b4274e0e33eafb5e9ead9d949ebf031a9fb8363b (diff) | |
parent | d1ba966140d7a60cd5ae4e8667ceb27c1a138592 (diff) |
Merge branch 'archwiki'
# Conflicts:
# skins/ArchLinux.php
# skins/ArchLinux/archlogo.gif
Diffstat (limited to 'resources/src/startup.js')
-rw-r--r-- | resources/src/startup.js | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/resources/src/startup.js b/resources/src/startup.js new file mode 100644 index 00000000..a62cc9d6 --- /dev/null +++ b/resources/src/startup.js @@ -0,0 +1,62 @@ +/** + * This script provides a function which is run to evaluate whether or not to + * continue loading jQuery and the MediaWiki modules. This code should work on + * even the most ancient of browsers, so be very careful when editing. + */ + +var mediaWikiLoadStart = ( new Date() ).getTime(); + +/** + * Returns false for Grade C supported browsers. + * + * This function should only be used by the Startup module, do not expand it to + * be generally useful beyond startup. + * + * See also: + * - https://www.mediawiki.org/wiki/Compatibility#Browsers + * - https://jquery.com/browser-support/ + */ + +/*jshint unused: false */ +function isCompatible( ua ) { + if ( ua === undefined ) { + ua = navigator.userAgent; + } + + // Browsers with outdated or limited JavaScript engines get the no-JS experience + return !( + // Internet Explorer < 8 + ( ua.indexOf( 'MSIE' ) !== -1 && parseFloat( ua.split( 'MSIE' )[1] ) < 8 ) || + // Firefox < 3 + ( ua.indexOf( 'Firefox/' ) !== -1 && parseFloat( ua.split( 'Firefox/' )[1] ) < 3 ) || + // Opera < 12 + ( ua.indexOf( 'Opera/' ) !== -1 && ( ua.indexOf( 'Version/' ) === -1 ? + // "Opera/x.y" + parseFloat( ua.split( 'Opera/' )[1] ) < 10 : + // "Opera/9.80 ... Version/x.y" + parseFloat( ua.split( 'Version/' )[1] ) < 12 + ) ) || + // "Mozilla/0.0 ... Opera x.y" + ( ua.indexOf( 'Opera ' ) !== -1 && parseFloat( ua.split( ' Opera ' )[1] ) < 10 ) || + // BlackBerry < 6 + ua.match( /BlackBerry[^\/]*\/[1-5]\./ ) || + // Open WebOS < 1.5 + ua.match( /webOS\/1\.[0-4]/ ) || + // Anything PlayStation based. + ua.match( /PlayStation/i ) || + // Any Symbian based browsers + ua.match( /SymbianOS|Series60/ ) || + // Any NetFront based browser + ua.match( /NetFront/ ) || + // Opera Mini, all versions + ua.match( /Opera Mini/ ) || + // Nokia's Ovi Browser + ua.match( /S40OviBrowser/ ) || + // 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. + */ |