mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-11-15 22:52:16 +03:00
32
src/ua-parser-extension.js
Normal file
32
src/ua-parser-extension.js
Normal file
@@ -0,0 +1,32 @@
|
||||
///////////////////////////////////////////////
|
||||
/* Extensions for UAParser.js v2.0
|
||||
https://github.com/faisalman/ua-parser-js
|
||||
Author: Faisal Salman <f@faisalman.com>
|
||||
MIT License */
|
||||
//////////////////////////////////////////////
|
||||
|
||||
const UAParser = require("./ua-parser")
|
||||
|
||||
const Bots = Object.freeze({
|
||||
browser : [
|
||||
[/((?:google|bing|msn|facebook)bot(?:\-[imagevdo]{5})?|bingpreview)\/([\w\.]+)/i], [UAParser.BROWSER.NAME, UAParser.BROWSER.VERSION, ['type', 'bot']]
|
||||
]
|
||||
});
|
||||
|
||||
const Emails = Object.freeze({
|
||||
browser : [
|
||||
[/(microsoft outlook|thunderbird)[\s\/]([\w\.]+)/i], [UAParser.BROWSER.NAME, UAParser.BROWSER.VERSION, ['type', 'email']]
|
||||
]
|
||||
});
|
||||
|
||||
const Tools = Object.freeze({
|
||||
browser : [
|
||||
[/(wget|curl|lynx)\/([\w\.]+)/i], [UAParser.BROWSER.NAME, UAParser.BROWSER.VERSION, ['type', 'tool']]
|
||||
]
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
Bots,
|
||||
Emails,
|
||||
Tools
|
||||
}
|
||||
36
src/ua-parser-extension.mjs
Normal file
36
src/ua-parser-extension.mjs
Normal file
@@ -0,0 +1,36 @@
|
||||
// Generated ESM version of UAParser.js extensions
|
||||
// DO NOT EDIT THIS FILE!
|
||||
// Source: /src/ua-parser-extension.js
|
||||
|
||||
///////////////////////////////////////////////
|
||||
/* Extensions for UAParser.js v2.0
|
||||
https://github.com/faisalman/ua-parser-js
|
||||
Author: Faisal Salman <f@faisalman.com>
|
||||
MIT License */
|
||||
//////////////////////////////////////////////
|
||||
|
||||
const UAParser = require("./ua-parser")
|
||||
|
||||
const Bots = Object.freeze({
|
||||
browser : [
|
||||
[/((?:google|bing|msn|facebook)bot(?:\-[imagevdo]{5})?|bingpreview)\/([\w\.]+)/i], [UAParser.BROWSER.NAME, UAParser.BROWSER.VERSION, ['type', 'bot']]
|
||||
]
|
||||
});
|
||||
|
||||
const Emails = Object.freeze({
|
||||
browser : [
|
||||
[/(microsoft outlook|thunderbird)[\s\/]([\w\.]+)/i], [UAParser.BROWSER.NAME, UAParser.BROWSER.VERSION, ['type', 'email']]
|
||||
]
|
||||
});
|
||||
|
||||
const Tools = Object.freeze({
|
||||
browser : [
|
||||
[/(wget|curl|lynx)\/([\w\.]+)/i], [UAParser.BROWSER.NAME, UAParser.BROWSER.VERSION, ['type', 'tool']]
|
||||
]
|
||||
});
|
||||
|
||||
export {
|
||||
Bots,
|
||||
Emails,
|
||||
Tools
|
||||
}
|
||||
Reference in New Issue
Block a user