faisalman / ua-parser-js

"Unmask Your Traffic" - UAParser.js: The Essential Web Development Tool for User-Agent Detection
https://uaparser.dev/
GNU Affero General Public License v3.0
9.28k stars 1.19k forks source link

Samsung galaxy tab s8 and s9 devices are not recognised #740

Open JDWaghela opened 3 months ago

JDWaghela commented 3 months ago

Library version 0.7.30

Describe the bug Samsung Galaxy Tab s8 and s9 are returning empty object in below code const { device } = UAParser(); Therefore we're not able to identified that these devices are tablet, and instead it is behaving like desktop mode.

To Reproduce Steps to reproduce the behavior:

const { device } = UAParser(); console.log(device); // resulting output is {}

Expected behavior It should return device type as tablet

Screenshots image

Smartphone (please complete the following information):

faisalman commented 3 months ago

Hi, can I get a confirmation of the detection result from https://uaparser.dev/?

JDWaghela commented 3 months ago

https://uaparser.dev/

@faisalman Please find below response from that site in tablets

Samsung Galaxy Tablet S8

{
  "ua": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36",
  "browser": {
    "name": "Chrome",
    "version": "123.0.6312.40",
    "major": "123"
  },
  "cpu": {
    "architecture": "amd64"
  },
  "device": {},
  "engine": {
    "name": "Blink",
    "version": "123.0.0.0"
  },
  "os": {
    "name": "Linux",
    "version": ""
  }
}

Samsung Galaxy Tablet S9

{
  "ua": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36",
  "browser": {
    "name": "Chrome",
    "version": "127.0.6533.64",
    "major": "127"
  },
  "cpu": {
    "architecture": "amd64"
  },
  "device": {},
  "engine": {
    "name": "Blink",
    "version": "127.0.0.0"
  },
  "os": {
    "name": "Linux",
    "version": ""
  }
}
developersoom commented 2 months ago

Hello @faisalman, A similar problem has occurred with Galaxy Note 9. Could you please check as well?

The result from https://uaparser.dev is as below.

{
  "ua": "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Mobile Safari/537.36",
  "browser": {
    "name": "Chrome",
    "version": "127.0.6533.103",
    "major": "127"
  },
  "cpu": {},
  "device": {
    "type": "mobile",
    "model": "SM-N960N"
  },
  "engine": {
    "name": "Blink",
    "version": "127.0.0.0"
  },
  "os": {
    "name": "Android",
    "version": "10.0.0"
  }
}

But using ua-parse-js(1.0.38), the result is as below(device is empty).

image

mastrobardo commented 1 month ago

I'm trying to use the library in our project, and this is exact issue we facing. Seems vendors are trying to market these tablets as desktop replacement. "linux"iswhat is really upsetting me

mastrobardo commented 1 month ago

Hello @faisalman, A similar problem has occurred with Galaxy Note 9. Could you please check as well?

The result from https://uaparser.dev is as below.

{
  "ua": "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Mobile Safari/537.36",
  "browser": {
    "name": "Chrome",
    "version": "127.0.6533.103",
    "major": "127"
  },
  "cpu": {},
  "device": {
    "type": "mobile",
    "model": "SM-N960N"
  },
  "engine": {
    "name": "Blink",
    "version": "127.0.0.0"
  },
  "os": {
    "name": "Android",
    "version": "10.0.0"
  }
}

But using ua-parse-js(1.0.38), the result is as below(device is empty).

image

image galaxy s9 on browserstack. android is never cited. Even worst, we dont know the model