Skip to content

Update Edge user agent detection for legacy version and modern version detection fix#45

Open
livenobin wants to merge 1 commit into
pocketarc:developfrom
livenobin:patch-1
Open

Update Edge user agent detection for legacy version and modern version detection fix#45
livenobin wants to merge 1 commit into
pocketarc:developfrom
livenobin:patch-1

Conversation

@livenobin

Copy link
Copy Markdown

Update Edge user agent detection for legacy version and modern version that detect Edge with keyword 'Edg'

Update Edge user agent detection for legacy version and modern version that detect Edge with keyword 'Edg'
@CraftedRO

Copy link
Copy Markdown

@NielBuys

Copy link
Copy Markdown

Two notes on this:

Order matters here. The Edg pattern will also match a legacy Edge/18… UA (the .*? in the matcher lets Edg + e/18… match), so if Edg comes first, legacy Edge gets caught by it and never reaches the legacy entry. The legacy Edge key needs to come before Edg:

'Edge' => 'Edge Legacy (Spartan)',
'Edg' => 'Edge',
Modern Edge UAs only contain Edg/ (no Edge), so they won't false-match the legacy entry.

The label itself doesn't matter — it's display-only, the key is what's regex-matched against the UA. On my fork I labelled the legacy one 'Edge Legacy (Spartan)' to match CI4's naming and make it obvious it's the old EdgeHTML browser rather than a detection bug, while keeping the modern one as just 'Edge'. Feel free to name them however, but the ordering above is the important part.

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

Successfully merging this pull request may close these issues.

3 participants