jenssegers / jenssegers/agent

Chrome detected as Opera

Open
#113 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
4.9k
Forks
546
PR merge metrics
No merged PRs in 30d

Description

Device:
**Xiaomi A1**

User Agent:
`Mozilla/5.0 (Linux; Android 8.0.0; Mi A1 Build/OPR1.170623.026) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.109 Mobile Safari/537.36`

Code:
`Agent::browser()`
`Agent::version()`

Return
'Opera'
NULL

I am try to debug, this issue caused by
` 'Opera' => 'Opera|OPR',`
when I change to
`'Opera' => 'Opera',`

`Agent::browser()` return Chrome browser.

[Agent.php line 44](https://github.com/jenssegers/agent/blob/master/src/Agent.php#L44)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at src/Agent.php line 44 and trace Agent::browser() and Agent::version() using the supplied Xiaomi user-agent string. Reproduce the reported Opera result and verify that the parser distinguishes this Chrome string from Opera while preserving the expected browser and version outputs.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.