mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-09-27 16:08:47 +03:00
Improve device detection for Generic device: capture its device model instead of its Android version
This commit is contained in:
parent
93552e0172
commit
6c6ff97e0c
@ -19,8 +19,8 @@
|
||||
// Constants
|
||||
/////////////
|
||||
|
||||
var LIBVERSION = '2.0.0', // UAParser.version
|
||||
UA_MAX_LENGTH = 500, // UA string over this length will be trimmed
|
||||
var LIBVERSION = '2.0.0',
|
||||
UA_MAX_LENGTH = 500,
|
||||
USER_AGENT = 'user-agent',
|
||||
EMPTY = '',
|
||||
UNKNOWN = '?',
|
||||
@ -864,7 +864,7 @@
|
||||
], [[TYPE, TABLET]], [
|
||||
/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i // Unidentifiable Mobile
|
||||
], [[TYPE, MOBILE]], [
|
||||
/(android[-\w\. ]{0,9});.+buil/i // Generic Android Device
|
||||
/droid .+?; ([\w\. -]+)( bui|\))/i // Generic Android Device
|
||||
], [MODEL, [VENDOR, 'Generic']]
|
||||
],
|
||||
|
||||
|
@ -1,10 +1,18 @@
|
||||
[
|
||||
{
|
||||
"desc": "Generic Android Device",
|
||||
"ua": "Dalvik/2.1.0 (Linux; U; Android 9; X96mini_RP Build/X96mini_RP)",
|
||||
"expect": {
|
||||
"vendor": "Generic",
|
||||
"model": "X96mini_RP"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc": "Generic Android Device",
|
||||
"ua": "Mozilla/5.0 (Linux; U; Android 6.0.1; i980 Build/MRA58K)",
|
||||
"expect": {
|
||||
"vendor": "Generic",
|
||||
"model": "Android 6.0.1"
|
||||
"model": "i980"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user