Opera's `navigator.userAgent` might not include the "Version/major.minor"
part, causing the code relying on it being present to blow up. This patch
fixes the issue.
Also added tests for Opera.
Change-Id: I9ceb7517e00042366e45cf13aa89262ed19709c0
}
// Expose Opera 10's lies about being Opera 9.8
if ( name === 'opera' && version >= 9.8) {
- version = ua.match( /version\/([0-9\.]*)/i )[1] || 10;
+ match = ua.match( /version\/([0-9\.]*)/i );
+ if ( match && match[1] ) {
+ version = match[1];
+ } else {
+ version = '10';
+ }
}
versionNumber = parseFloat( version, 10 ) || 0.0;
}
},
// Safari 5
- // Opera 10
+ // Opera 10+
+ 'Opera/9.80 (Windows NT 5.1)': {
+ title: 'Opera 10+ (exact version unspecified)',
+ platform: 'Win32',
+ profile: {
+ name: 'opera',
+ layout: 'presto',
+ layoutVersion: 'unknown',
+ platform: 'win',
+ version: '10',
+ versionBase: '10',
+ versionNumber: 10
+ },
+ wikiEditor: {
+ ltr: true,
+ rtl: true
+ }
+ },
+ // Opera 12
+ 'Opera/9.80 (Windows NT 5.1) Presto/2.12.388 Version/12.11': {
+ title: 'Opera 12',
+ platform: 'Win32',
+ profile: {
+ name: 'opera',
+ layout: 'presto',
+ layoutVersion: 'unknown',
+ platform: 'win',
+ version: '12.11',
+ versionBase: '12',
+ versionNumber: 12.11
+ },
+ wikiEditor: {
+ ltr: true,
+ rtl: true
+ }
+ },
// Chrome 5
// Chrome 6
// Chrome 7