Improve device detection for Generic device: capture its device model instead of its Android version

This commit is contained in:
Faisal Salman
2024-12-16 11:05:24 +07:00
parent 93552e0172
commit 6c6ff97e0c
2 changed files with 12 additions and 4 deletions

View File

@@ -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']]
],