Merge pull request #295 from willamesoares/master
Add support for using short version for browser name in satisfiespull/316/head
commit
19288762f1
@ -0,0 +1,41 @@
|
|||||||
|
// NOTE: this list must be up-to-date with browsers listed in
|
||||||
|
// test/acceptance/useragentstrings.yml
|
||||||
|
const BROWSER_ALIASES_MAP = {
|
||||||
|
'Amazon Silk': 'amazon_silk',
|
||||||
|
'Android Browser': 'android',
|
||||||
|
Bada: 'bada',
|
||||||
|
BlackBerry: 'blackberry',
|
||||||
|
Chrome: 'chrome',
|
||||||
|
Chromium: 'chromium',
|
||||||
|
Epiphany: 'epiphany',
|
||||||
|
Firefox: 'firefox',
|
||||||
|
Focus: 'focus',
|
||||||
|
Generic: 'generic',
|
||||||
|
Googlebot: 'googlebot',
|
||||||
|
'Internet Explorer': 'ie',
|
||||||
|
'K-Meleon': 'k_meleon',
|
||||||
|
Maxthon: 'maxthon',
|
||||||
|
'Microsoft Edge': 'edge',
|
||||||
|
'MZ Browser': 'mz',
|
||||||
|
'NAVER Whale Browser': 'naver',
|
||||||
|
Opera: 'opera',
|
||||||
|
'Opera Coast': 'opera_coast',
|
||||||
|
PhantomJS: 'phantomjs',
|
||||||
|
Puffin: 'puffin',
|
||||||
|
QupZilla: 'qupzilla',
|
||||||
|
Safari: 'safari',
|
||||||
|
Sailfish: 'sailfish',
|
||||||
|
SeaMonkey: 'seamonkey',
|
||||||
|
Sleipnir: 'sleipnir',
|
||||||
|
Swing: 'swing',
|
||||||
|
Tizen: 'tizen',
|
||||||
|
'UC Browser': 'uc',
|
||||||
|
Vivaldi: 'vivaldi',
|
||||||
|
'WebOS Browser': 'webos',
|
||||||
|
WeChat: 'wechat',
|
||||||
|
'Yandex Browser': 'yandex',
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
BROWSER_ALIASES_MAP,
|
||||||
|
};
|
@ -0,0 +1,15 @@
|
|||||||
|
import test from 'ava';
|
||||||
|
import { BROWSER_ALIASES_MAP } from '../../src/constants';
|
||||||
|
|
||||||
|
test('check duplicate aliases', (t) => {
|
||||||
|
const aliasesList = Object.keys(BROWSER_ALIASES_MAP).map(value => (BROWSER_ALIASES_MAP[value]));
|
||||||
|
let foundOnce, foundTwice;
|
||||||
|
|
||||||
|
const duplicates = aliasesList.filter(item => {
|
||||||
|
foundOnce = aliasesList.indexOf(item);
|
||||||
|
foundTwice = aliasesList.indexOf(item, foundOnce + 1);
|
||||||
|
return +foundTwice !== -1;
|
||||||
|
});
|
||||||
|
|
||||||
|
t.deepEqual(duplicates, []);
|
||||||
|
});
|
Loading…
Reference in new issue