1
0
mirror of https://github.com/lancedikson/bowser synced 2024-10-27 20:34:22 +00:00

Add Windows OS descriptor

This commit is contained in:
Denis Demchenko 2017-05-18 23:14:31 +03:00
parent f5be32be3b
commit 59fc2d639f

View File

@ -1,5 +1,21 @@
import { getFirstMatch } from './utils'; import { getFirstMatch } from './utils';
function getWindowsVersionName(version) {
switch (version) {
case 'NT': return 'NT';
case 'XP': return 'XP';
case 'NT 5.0': return '2000';
case 'NT 5.1': return 'XP';
case 'NT 5.2': return '2003';
case 'NT 6.0': return 'Vista';
case 'NT 6.1': return '7';
case 'NT 6.2': return '8';
case 'NT 6.3': return '8.1';
case 'NT 10.0': return '10';
default: return undefined;
}
}
export default [ export default [
{ {
test: [/windows phone/i], test: [/windows phone/i],
@ -11,6 +27,19 @@ export default [
} }
} }
}, },
{
test: [/windows/i],
describe(ua) {
const version = getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i, ua);
const versionName = getWindowsVersionName(version);
return {
name: 'Windows',
version,
versionName
};
}
},
{ {
test: [/macintosh/i], test: [/macintosh/i],
describe(ua) { describe(ua) {