mirror of
https://github.com/lancedikson/bowser
synced 2025-12-05 06:02:14 +00:00
tests fix pt.1
This commit is contained in:
parent
4050a25bd2
commit
bb05390d43
@ -133,19 +133,10 @@ const browsersList = [
|
|||||||
/* MetaWebCrawler */
|
/* MetaWebCrawler */
|
||||||
{
|
{
|
||||||
test: [/facebookexternalhit/i, /facebookcatalog/i],
|
test: [/facebookexternalhit/i, /facebookcatalog/i],
|
||||||
describe(ua) {
|
describe() {
|
||||||
const browser = {
|
return {
|
||||||
name: 'MetaWebCrawler',
|
name: 'MetaWebCrawler',
|
||||||
};
|
};
|
||||||
const version = Utils.getFirstMatch(/facebookexternalhit\/(\d+(\.\d+)+)/i, ua)
|
|
||||||
|| Utils.getFirstMatch(/facebookcatalog\/(\d+(\.\d+)+)/i, ua)
|
|
||||||
|| Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
||||||
|
|
||||||
if (version) {
|
|
||||||
browser.version = version;
|
|
||||||
}
|
|
||||||
|
|
||||||
return browser;
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -162,34 +153,20 @@ const browsersList = [
|
|||||||
/* YandexBot */
|
/* YandexBot */
|
||||||
{
|
{
|
||||||
test: [/yandexbot/i, /yandexmobilebot/i],
|
test: [/yandexbot/i, /yandexmobilebot/i],
|
||||||
describe(ua) {
|
describe() {
|
||||||
const browser = {
|
return {
|
||||||
name: 'YandexBot',
|
name: 'YandexBot',
|
||||||
};
|
};
|
||||||
const version = Utils.getFirstMatch(/yandex(?:bot|mobilebot)\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
||||||
|
|
||||||
if (version) {
|
|
||||||
browser.version = version;
|
|
||||||
}
|
|
||||||
|
|
||||||
return browser;
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
/* PingdomBot */
|
/* PingdomBot */
|
||||||
{
|
{
|
||||||
test: [/pingdom/i],
|
test: [/pingdom/i],
|
||||||
describe(ua) {
|
describe() {
|
||||||
const browser = {
|
return {
|
||||||
name: 'PingdomBot',
|
name: 'PingdomBot',
|
||||||
};
|
};
|
||||||
const version = Utils.getFirstMatch(/version[_/](\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(/pingdom\.com_bot_.*?(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
|
||||||
|
|
||||||
if (version) {
|
|
||||||
browser.version = version;
|
|
||||||
}
|
|
||||||
|
|
||||||
return browser;
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user