jenssegers / jenssegers/agent

$agent->is('Chrome') returns true for edge

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

Description

Hello, with version `2.6.0` on php 7.0, Edge

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36 Edge/15.15063

is detected as Chrome with `$agent->is('Chrome')`

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.109 Safari/537.36

The 2 are distinguished correctly by http://php.net/manual/en/function.get-browser.php, so I guess it's something with this library, and the method `$agent->browser()` returns the correct browser name.

Why this discrepance? Is it intended? Does the documentation need an update?

Thank you

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the $agent->is('Chrome') and $agent->browser() entry points and compare their handling of the two supplied user-agent strings. Determine whether Edge should be excluded from the Chrome match, then verify the intended behavior with the project's existing tests or documentation; done means the distinction is resolved and documented or covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.