Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent Browser Detection for QQ in Versions 0.8.1 and v1+ #774

Open
NangGongZhiXiao opened this issue Dec 20, 2024 · 1 comment
Open

Comments

@NangGongZhiXiao
Copy link

Library version
v0.8.1 and v1+

Describe the bug
I have encountered an issue with the ua-parser-js library where the browser detection results for the QQ user agent are inconsistent between version 0.8.1 and versions v1.0.0 and above. The expected behavior is that the library should return "QQ" for the QQ browser user agent, but it returns "QQBrowser" in the newer versions.
To Reproduce
Verification Code:

import { UAParser } from 'ua-parser-js';

console.log(new UAParser('User Agent: Mozilla/5.0 (Linux; Android 14; V2183A Build/UP1A.231005.007; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/121.0.6167.71 MQQBrowser/6.2 TBS/047205 Mobile Safari/537.36 V1_AND_SQ_9.0.65_6588_YYB_D QQ/9.0.65.17370 NetType/WIFI WebP/0.3.0 AppId/537225141 Pixel/1080 StatusBarHeight/96 SimpleUISwitch/0 QQTheme/1000 StudyMode/0 CurrentMode/0 CurrentFontScale/1.0 GlobalDensityScale/0.90000004 AllowLandscape/false InMagicWin/0').getBrowser());

Results:
using [email protected]:

  {
    name: "QQ",
    version: "9.0.65.17370",
    major: "9"
  }

using [email protected]

IData {
  name: "QQBrowser",
  version: "9.0.65.17370",
  major: "9",
  type: undefined,
  getItem: [Function],
  withClientHints: [Function],
  withFeatureCheck: [Function],
  is: [Function],
  toString: [Function],
  then: [Function],
}

Expected behavior
The expected output for the QQ user agent should consistently return "QQ" across all versions of the library, rather than "QQBrowser" in versions v1.0.0 and above.

Additional context
This inconsistency could lead to issues in applications that depend on accurate browser identification for feature detection or analytics. I would appreciate any guidance on resolving this issue or any plans for addressing it in future releases.
Thank you!

@faisalman
Copy link
Owner

Hi @NangGongZhiXiao, this change was first introduced in this commit: 1a2ef00 (added in 0.7.39 / 1.0.39 / 2.0.0-beta.3) in order to unify the detection of both QQ & QQBrowser since they’re essentially the same browser.

Moving forward it'll be consistently referred to as QQBrowser, as defined in the Browser enum:

QQ: 'QQBrowser',
QQ_LITE: 'QQBrowserLite',

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants