mirror of
https://github.com/lancedikson/bowser
synced 2026-09-25 05:25:07 +00:00
feat: add more bot platforms (#542)
Co-authored-by: naorpeled <me@naor.dev>
This commit is contained in:
@@ -45,6 +45,131 @@ const browsersList = [
|
||||
},
|
||||
},
|
||||
|
||||
/* AmazonBot */
|
||||
{
|
||||
test: [/amazonbot/i],
|
||||
describe(ua) {
|
||||
const browser = {
|
||||
name: 'AmazonBot',
|
||||
};
|
||||
const version = Utils.getFirstMatch(/amazonbot\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
||||
|
||||
if (version) {
|
||||
browser.version = version;
|
||||
}
|
||||
|
||||
return browser;
|
||||
},
|
||||
},
|
||||
|
||||
/* BingCrawler */
|
||||
{
|
||||
test: [/bingbot/i],
|
||||
describe(ua) {
|
||||
const browser = {
|
||||
name: 'BingCrawler',
|
||||
};
|
||||
const version = Utils.getFirstMatch(/bingbot\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
||||
|
||||
if (version) {
|
||||
browser.version = version;
|
||||
}
|
||||
|
||||
return browser;
|
||||
},
|
||||
},
|
||||
|
||||
/* BaiduSpider */
|
||||
{
|
||||
test: [/baiduspider/i],
|
||||
describe(ua) {
|
||||
const browser = {
|
||||
name: 'BaiduSpider',
|
||||
};
|
||||
const version = Utils.getFirstMatch(/baiduspider\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
||||
|
||||
if (version) {
|
||||
browser.version = version;
|
||||
}
|
||||
|
||||
return browser;
|
||||
},
|
||||
},
|
||||
|
||||
/* DuckDuckBot */
|
||||
{
|
||||
test: [/duckduckbot/i],
|
||||
describe(ua) {
|
||||
const browser = {
|
||||
name: 'DuckDuckBot',
|
||||
};
|
||||
const version = Utils.getFirstMatch(/duckduckbot\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
||||
|
||||
if (version) {
|
||||
browser.version = version;
|
||||
}
|
||||
|
||||
return browser;
|
||||
},
|
||||
},
|
||||
|
||||
/* InternetArchiveCrawler */
|
||||
{
|
||||
test: [/ia_archiver/i],
|
||||
describe(ua) {
|
||||
const browser = {
|
||||
name: 'InternetArchiveCrawler',
|
||||
};
|
||||
const version = Utils.getFirstMatch(/ia_archiver\/(\d+(\.\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);
|
||||
|
||||
if (version) {
|
||||
browser.version = version;
|
||||
}
|
||||
|
||||
return browser;
|
||||
},
|
||||
},
|
||||
|
||||
/* MetaWebCrawler */
|
||||
{
|
||||
test: [/facebookexternalhit/i, /facebookcatalog/i],
|
||||
describe() {
|
||||
return {
|
||||
name: 'MetaWebCrawler',
|
||||
};
|
||||
},
|
||||
},
|
||||
|
||||
/* YahooSlurp */
|
||||
{
|
||||
test: [/yahoo!?[\s/]*slurp/i],
|
||||
describe() {
|
||||
return {
|
||||
name: 'YahooSlurp',
|
||||
};
|
||||
},
|
||||
},
|
||||
|
||||
/* YandexBot */
|
||||
{
|
||||
test: [/yandexbot/i, /yandexmobilebot/i],
|
||||
describe() {
|
||||
return {
|
||||
name: 'YandexBot',
|
||||
};
|
||||
},
|
||||
},
|
||||
|
||||
/* PingdomBot */
|
||||
{
|
||||
test: [/pingdom/i],
|
||||
describe() {
|
||||
return {
|
||||
name: 'PingdomBot',
|
||||
};
|
||||
},
|
||||
},
|
||||
|
||||
/* Opera < 13.0 */
|
||||
{
|
||||
test: [/opera/i],
|
||||
|
||||
Reference in New Issue
Block a user