Skip to content

Commit 4bba1a0

Browse files
authored
Detect new brands: HEC, MAG, NoviSea, S-Color, W&O and Detect devices for exist brands (#182)
* chore: test tool improvement added new output mode * feat(ts) added restoreUserAgentFromClientHints to typescript declaration class * Detect new brand NoviSea and Detect devices for exist brands (matomo-org#7670) feat(device) detect brand Wileyfox: Swift 2 Plus feat(device) detect brand Reeder: S19 Max L, S19 Max, S19 Max Pro feat(device) detect brand iTel: P55 5G (P661N) feat(device) detect brand OMIX: X700 feat(device) detect brand ONYX BOOX: Volta 4 feat(device) detect new brand NoviSea: A10 feat(device) detect brand Huawei: Honor Magic 5 (PGT-AN00) feat(device) detect brand AllCall: Shine 12 Pro feat(device) detect brand Blackview: BV4800 feat(device) detect brand Acer: Liquid Z500 feat(device) detect brand OPPO: A1i 5G (PJU110) feat(device) detect brand ZTE: 5G UG Phone U23 feat(device) detect brand Doogee: S51 feat(device) detect brand TwinMOS: T103GQ1 feat(device) detect brand Pritom: M10 feat(device) detect brand DEXP: B31 feat(device) detect brand Explay: Tornado 8 feat(device) detect brand W&O: WO9 feat(device) detect brand Hyundai: H-LED50FU7001, H-LED55BU7003, H-DMP103 feat(device) detect brand Accesstyle: H32EY1500B feat(device) detect brand NEXON: X3 feat(device) detect brand Hartens: HTY-43FHD06B-S2-T9 feat(device) detect brand SUNWIND: Sky 1264C 4G feat(device) detect brand Samsung: Galaxy Tab S9 FE+ 12.4" 5G (SM-X616B) feat(device) detect brand TCL: 303 (5131G) * Detect new brands: HEC, W&O and Detect devices for exist brands (matomo-org#7667) feat(device) detect brand F+: SH65 feat(device) detect brand Oukitel: WP2 feat(device) detect brand Hammer: Energy X feat(device) detect brand Yandex: YNDX-00092 feat(device) detect new brand W&O: X9 Call 2 feat(device) detect brand OMIX: X400, X600 feat(device) detect brand Nokia: C300, G100 feat(device) detect brand Vortex: HD62 feat(device) detect brand NEXON: X5+ feat(device) detect brand General Mobile: GM 6 DS (G100) feat(device) detect brand Infinix: Hot 40 (X6836) feat(device) detect new brand HEC: R1 50S 4K (50SSD-SMART TV-R1) * Detect new brands: MAG, S-Color and Detect devices for exist brands (matomo-org#7666) feat(device) detect new brand MAG: CRD55-UHD9 feat(device) detect brand Xiaomi: Mi Smart Compact Projector feat(device) detect brand Winmax: Tiger X12 feat(device) detect brand ZTE: Blade V50 Design (8050) feat(device) detect brand Huawei: Enjoy 70 (FGD-AL00) feat(device) detect brand Vivo: iQOO Z1x 5G feat(device) detect brand Digma: Pro Hit 16 10.4" (HS1002PL) feat(device) detect brand Sigma: Tab A802 feat(device) detect brand Artel: R3 GTV (R3G) feat(device) detect brand Teclast: P26T feat(device) detect brand MTC: DV9135 feat(device) detect new brand S-Color: GT40 Ultra feat(device) detect brand CUBOT: P60 feat(device) detect brand Sparx: Neo 8 Plus feat(device) detect brand Grape: GTM-5v.5 feat(device) detect brand Bravis: NP747 SD feat(device) detect brand Vivo: X90 Pro (V2219), X100 (V2308) feat(device) detect brand Huawei: Honor Play 8T (CLK-AN00), Honor MagicPad 13 WiFi (GDI-W09) feat(device) detect brand Xiaomi: Mi Max 3 Pro feat(device) detect brand OLTO: 43ST20H feat(device) detect brand Vekta: LD-32SR5112BS * Improves detection for mobile devices (matomo-org#7665) Adds detection for Mintt CoolMintt Tribe Update model names per convention Adds detection for Samsung Galaxy S24 Adds detection for Samsung Galaxy S24 Ultra Improves detection for Samsung Galaxy S24 Adds detection for Kyocera Digno Keitai R
1 parent b55968d commit 4bba1a0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+3751
-1726
lines changed

index.d.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { JSONObject } from './client-hints';
2+
13
export default class DeviceDetector {
24
/**
35
* @param {DeviceDetectorOptions} options
@@ -157,6 +159,14 @@ export default class DeviceDetector {
157159
* @param {*} parser
158160
*/
159161
addParseVendor(name: string, parser: any): void;
162+
163+
/**
164+
* restore original userAgent from clientHints object
165+
* @param {string} userAgent
166+
* @param {JSONObject} clientHints
167+
* @return string
168+
*/
169+
restoreUserAgentFromClientHints(userAgent: string, clientHints?: JSONObject): string;
160170
}
161171

162172
export interface DeviceDetectorOptions {

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -669,11 +669,11 @@ class DeviceDetector {
669669
}
670670

671671
/**
672-
* restore original userAgent for clientHints object
672+
* restore original userAgent from clientHints object
673673
* @param {string} userAgent
674674
* @param {{os:{version:''}, device: {model:''}}} clientHints
675675
*/
676-
restoreUserAgentForClientHints(
676+
restoreUserAgentFromClientHints(
677677
userAgent,
678678
clientHints
679679
) {
@@ -700,7 +700,7 @@ class DeviceDetector {
700700
* @return {ResultDevice}
701701
*/
702702
parseDevice(userAgent, clientHints) {
703-
let ua = this.restoreUserAgentForClientHints(userAgent, clientHints);
703+
let ua = this.restoreUserAgentFromClientHints(userAgent, clientHints);
704704
let brandIndexes = [];
705705
let deviceCode = '';
706706

parser/device/brand-short.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,7 @@ module.exports = {
599599
'9F': 'HAOVM',
600600
'HAQ': 'HAOQIN',
601601
'HA': 'Haier',
602+
'HEC': 'HEC',
602603
'XH': 'Haipai',
603604
'HAN': 'Handheld',
604605
'HE': 'HannSpree',
@@ -899,6 +900,7 @@ module.exports = {
899900
'92': 'MAC AUDIO',
900901
'MJ': 'Majestic',
901902
'FQ': 'Mafe',
903+
'MAG': 'MAG',
902904
'6Y': 'Magicsee',
903905
'23': 'Magnus',
904906
'NH': 'Manhattan',
@@ -1066,6 +1068,7 @@ module.exports = {
10661068
'N1': 'Noain',
10671069
'N6': 'Nobby',
10681070
'NOC': 'Novacom',
1071+
'NOS': 'NoviSea',
10691072
'NOV': 'Novey',
10701073
'NO1': 'NOVO',
10711074
'57': 'Nubia',
@@ -1308,6 +1311,7 @@ module.exports = {
13081311
'RY': 'Ryte',
13091312
'X5': 'Saba',
13101313
'8L': 'S-TELL',
1314+
'8L1': 'S-Color',
13111315
'4O': 'S2Tel',
13121316
'89': 'Seatel',
13131317
'SEW': 'Sewoo',
@@ -1690,6 +1694,7 @@ module.exports = {
16901694
'WAK': 'Walker',
16911695
'WA': 'Walton',
16921696
'WAF': 'WAF',
1697+
'WAO': 'W&O',
16931698
'WAL': 'Waltter',
16941699
'WHI': 'White Mobile',
16951700
'WBL': 'We. by Loewe.',

parser/device/device-trusted.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ const checkDisplaySize = (deviceData, clientHints) => {
8080
deviceWidth = resolution[0];
8181
deviceHeight = resolution[1];
8282
} else {
83-
deviceWidth = deviceInfo.display && deviceInfo.display.resolution.width
83+
deviceWidth = deviceInfo.display && deviceInfo.display.resolution && deviceInfo.display.resolution.width
8484
? deviceInfo.display.resolution.width
8585
: null;
86-
deviceHeight = deviceInfo.display && deviceInfo.display.resolution.height
86+
deviceHeight = deviceInfo.display && deviceInfo.display.resolution && deviceInfo.display.resolution.height
8787
? deviceInfo.display.resolution.height
8888
: null;
8989
}

parser/os-abstract-parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ class OsAbstractParser extends ParserAbstract {
302302
* @return {string}
303303
*/
304304
parsePlatform(userAgent) {
305-
if (this.getBaseRegExp('arm|aarch64|Apple ?TV|Watch ?OS|Watch1,[12]').test(userAgent)) {
305+
if (this.getBaseRegExp('arm|.*arm64|aarch64|Apple ?TV|Watch ?OS|Watch1,[12]').test(userAgent)) {
306306
return 'ARM';
307307
}
308308
if (this.getBaseRegExp('loongarch64').test(userAgent)) {

regexes/bots.yml

Lines changed: 57 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -552,9 +552,9 @@
552552
url: 'http://moz.com/'
553553

554554
- regex: 'facebookexternalhit|facebookplatform|facebookexternalua|facebookcatalog'
555-
name: 'Facebook External Hit'
555+
name: 'Facebook Crawler'
556556
category: 'Social Media Agent'
557-
url: 'https://www.facebook.com/externalhit_uatext.php'
557+
url: 'https://developers.facebook.com/docs/sharing/webmasters/crawler/'
558558
producer:
559559
name: 'Meta Platforms, Inc.'
560560
url: 'https://www.meta.com/'
@@ -4374,10 +4374,63 @@
43744374
name: 'Library and Archives Canada'
43754375
url: 'https://library-archives.canada.ca/'
43764376

4377+
- regex: 'InsytfulBot/[\d.]+'
4378+
name: 'InsytfulBot'
4379+
category: 'Crawler'
4380+
url: 'https://www.insytful.com/'
4381+
producer:
4382+
name: 'Zengenti Limited'
4383+
url: 'https://www.zengenti.com/'
4384+
4385+
- regex: 'statista\.com'
4386+
name: 'Statista'
4387+
category: 'Crawler'
4388+
url: 'https://www.statista.com/'
4389+
producer:
4390+
name: 'Statista, Inc.'
4391+
url: 'https://www.statista.com/'
4392+
4393+
- regex: 'SubstackContentFetch/[\d.]+'
4394+
name: 'Substack Content Fetch'
4395+
category: 'Crawler'
4396+
url: 'https://substack.com/'
4397+
producer:
4398+
name: 'Substack, Inc.'
4399+
url: 'https://substack.com/'
4400+
4401+
- regex: '^ds9'
4402+
name: 'Deep SEARCH 9'
4403+
category: 'Crawler'
4404+
url: 'https://www.copyright.com/blog/ccc-expands-corporate-solutions-offering-with-new-technology/'
4405+
producer:
4406+
name: 'Copyright Clearance Center, Inc.'
4407+
url: 'https://www.copyright.com/'
4408+
4409+
- regex: 'LiveJournal\.com'
4410+
name: 'LiveJournal'
4411+
url: 'https://www.livejournal.com/'
4412+
category: 'Feed Fetcher'
4413+
producer:
4414+
name: 'ООО "СИМ"'
4415+
url: 'https://www.livejournal.com/'
4416+
4417+
- regex: 'bitdiscovery'
4418+
name: 'Tenable.asm'
4419+
category: 'Security Checker'
4420+
url: 'https://bitdiscovery.com/'
4421+
producer:
4422+
name: 'Tenable, Inc.'
4423+
url: 'https://www.tenable.com/'
4424+
4425+
- regex: 'Castopod/[\d.]+'
4426+
name: 'Castopod'
4427+
category: 'Crawler'
4428+
url: 'https://www.castopod.org/'
4429+
43774430
# Generic bots
4378-
- regex: 'nuhk|grub-client|Download Demon|SearchExpress|Microsoft URL Control|borg|altavista|dataminr\.com|teoma|oegp|http%20client|htdig|mogimogi|larbin|scrubby|searchsight|semanticdiscovery|snappy|vortex(?!(?: Build|Plus))|zeal(?!ot)|dataparksearch|findlinks|BrowserMob|URL2PNG|ZooShot|GomezA|Google SketchUp|Read%20Later|7Siters|centuryb\.o\.t9|InterNaetBoten|EasyBib AutoCite|Bidtellect|tomnomnom/meg|cortex|Re-re Studio|adreview|AHC/|NameOfAgent|Request-Promise|ALittle Client|Hello,? world|wp_is_mobile|0xAbyssalDoesntExist|Anarchy99|^revolt|nvd0rz|xfa1|Hakai|gbrmss|fuck-your-hp|IDBTE4M CODE87|Antoine|Insomania|Hells-Net|b3astmode|Linux Gnu \(cow\)|Test Certificate Info|iplabel|Magellan|TheSafex?Internetx?Search|Searcherweb|kirkland-signature|LinkChain|survey-security-dot-txt|^xenu|^ZmEu|^(?:chrome|firefox|Zeus)$'
4431+
- regex: 'nuhk|grub-client|Download Demon|SearchExpress|Microsoft URL Control|borg|altavista|dataminr\.com|teoma|oegp|http%20client|htdig|mogimogi|larbin|scrubby|searchsight|semanticdiscovery|snappy|vortex(?!(?: Build|Plus))|zeal(?!ot)|dataparksearch|findlinks|BrowserMob|URL2PNG|ZooShot|GomezA|Google SketchUp|Read%20Later|7Siters|centuryb\.o\.t9|InterNaetBoten|EasyBib AutoCite|Bidtellect|tomnomnom/meg|cortex|Re-re Studio|adreview|AHC/|NameOfAgent|Request-Promise|ALittle Client|Hello,? world|wp_is_mobile|0xAbyssalDoesntExist|Anarchy99|^revolt|nvd0rz|xfa1|Hakai|gbrmss|fuck-your-hp|IDBTE4M CODE87|Antoine|Insomania|Hells-Net|b3astmode|Linux Gnu \(cow\)|Test Certificate Info|iplabel|Magellan|TheSafex?Internetx?Search|Searcherweb|kirkland-signature|LinkChain|survey-security-dot-txt|infrawatch|^xenu|^(?:chrome|firefox|KvshClient|Zeus|ZmEu)$'
43794432
name: 'Generic Bot'
43804433

43814434
# Generic detections
4382-
- regex: '[a-z0-9_-]*(?:(?<!cu|power[ _]|m[ _])bot(?![ _]TAB|[ _]?5[0-9]|[ _]Senior|[ _]Junior)|analyzer|appengine|archiver?|checker|collector|crawl|crawler|fetcher|indexer|inspector|monitor|project(?!or)|(?<!Google Wap )proxy|research|resolver|robots|scanner|scraper|script|searcher|(?<!-)security|spider|study|transcoder|uptime|user[ _]?agent|validator)(?:[^a-z]|$)'
4435+
- regex: '[a-z0-9_-]*(?:(?<!cu|power[ _]|m[ _])bot(?![ _]TAB|[ _]?5[0-9]|[ _]Senior|[ _]Junior)|analyzer|appengine|archiver?|checker|collector|crawl|crawler|(?<!node-|uclient-|Mikrotik/\d\.[x\d] |electron-)fetch(?:er)?|indexer|inspector|monitor|(?<!Microsoft |banshee-)project(?!or)|(?<!Google Wap |Blue )proxy|research|resolver|robots|(?<!Cam)scanner|scraper|script|searcher|(?<!-)security|spider|study|transcoder|uptime|user[ _]?agent|validator)(?:[^a-z]|$)'
43834436
name: 'Generic Bot'

0 commit comments

Comments
 (0)