diff --git a/projects/ngx-device-detector/src/lib/device-detector.constants.ts b/projects/ngx-device-detector/src/lib/device-detector.constants.ts index 8730d08..7a95e82 100644 --- a/projects/ngx-device-detector/src/lib/device-detector.constants.ts +++ b/projects/ngx-device-detector/src/lib/device-detector.constants.ts @@ -342,6 +342,7 @@ export const TABLETS_RE = { HisenseTablet: /\b(F5281|E2371)\b/, Hudl: /Hudl HT7S3|Hudl 2/, TelstraTablet: /T-Hub2/, + Honeywell: /RT10A/, GenericTablet: new RegExp(`Android.*\\b97D\\b|Tablet(?!.*PC)|BNTV250A|MID-WCDMA|LogicPD Zoom2|\\bA7EB\\b|CatNova8| A1_07|CT704|CT1002|\\bM721\\b|rk30sdk|\\bEVOTAB\\b|M758A|ET904|ALUMIUM10|Smartfren Tab|Endeavour 1010| Tablet-PC-4|Tagi Tab|\\bM6pro\\b|CT1020W|arc 10HD|\\bTP750\\b|\\bQTAQZ3\\b|WVT101|TM1088|KT107`), @@ -384,6 +385,7 @@ export const DEVICES = { SIMVALLEY: 'Simvalley', WOLFGANG: 'Wolfgang', ALCATEL: 'Alcatel', + HONEYWELL: 'Honeywell', NINTENDO: 'Nintendo', AMOI: 'Amoi', INQ: 'INQ', diff --git a/projects/ngx-device-detector/src/lib/device-detector.service.spec.ts b/projects/ngx-device-detector/src/lib/device-detector.service.spec.ts index 84f3b2c..3667f51 100644 --- a/projects/ngx-device-detector/src/lib/device-detector.service.spec.ts +++ b/projects/ngx-device-detector/src/lib/device-detector.service.spec.ts @@ -263,6 +263,22 @@ describe('DeviceDetectorService', () => { } )); + it('should detect Device Honeywell RT10A as a tablet', inject( + [DeviceDetectorService], + (service: DeviceDetectorService) => { + const userAgent = 'Mozilla/5.0 (Linux; Android 10; RT10A) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.101 Safari/537.36'; + service.setDeviceInfo(userAgent); + expect(service.isMobile(userAgent)).toBeFalsy(); + expect(service.isDesktop(userAgent)).toBeFalsy(); + expect(service.isTablet(userAgent)).toBeTruthy(); + const deviceInfo = service.getDeviceInfo(); + expect(deviceInfo.device).toBe('Android'); + expect(deviceInfo.browser).toBe('Chrome'); + expect(deviceInfo.browser_version).toBe('87.0.4280.101'); + expect(deviceInfo.deviceType).toBe('tablet'); + } + )); + /** * Issues list below * https://github.com/KoderLabs/ngx-device-detector/issues/191