serbanghita / Mobile-Detect

Mobile_Detect is a lightweight PHP class for detecting mobile devices (including tablets). It uses the User-Agent string combined with specific HTTP headers to detect the mobile environment.
http://mobiledetect.net
MIT License
10.52k stars 2.67k forks source link

Edge on iOS 12 is detected as Safari #764

Closed rainerjungwirth closed 3 years ago

rainerjungwirth commented 5 years ago

The Edge Browser (42.5.3) under iOS 12 is detected as Safari when using

$detect = new Mobile_Detect; $detect->is('Safari');

mimmi20 commented 5 years ago

@rainerjungwirth Please add the useragent.

rainerjungwirth commented 5 years ago

@mimmi20 This is the useragent when browsing in edge

Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 EdgiOS/42.5.3 Mobile/16A366 Safari/605.1.15

3Nex commented 4 years ago

Came here to submit an almost exact issue. The new version of Chromium-based Edge for desktop suffers from the same thing, because the new user agent on desktop features the substring Edg instead of Edge, and therefore also gets reported as Safari.

Explained here: https://docs.microsoft.com/en-us/microsoft-edge/web-platform/user-agent-string
The mobile versions of Edge are alse referenced there, where it says:

The Edg token is also consistent with existing tokens used on iOS and Android.

serbanghita commented 3 years ago

@rainerjungwirth I fixed the collision between Safari and Edge on iOS. Fix available in https://github.com/serbanghita/Mobile-Detect/releases/tag/2.8.36