bestiejs / platform.js

A platform detection library.
https://mths.be/platform
MIT License
3.22k stars 408 forks source link

Bug with Microsoft Edge based on Chromium in version 1.3.6 #185

Open barinbritva opened 4 years ago

barinbritva commented 4 years ago

In platform.js of version 1.3.5 Edge based on Chromium was detecting as Chrome. The UA:

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

I upgraded the library to 1.3.6 and now I see the browser name is Microsoft Edge. And the strangest thing here - sometimes it's still Chrome. I don't know how is it possible. But I tried in exactly the same browser.

bnjmnt4n commented 4 years ago

Seems like Edge might be switching it's user agent string on the sly. Not sure what we can do to handle this. If you manage to capture the user agent string when this occurs, do post it here.

barinbritva commented 4 years ago

@bnjmnt4n, actually the problem is the user agent always the same, but the results is different. I couldn't find any logic. But I rollbacked the platform to version 1.3.5 and everything work perfectly.

If I find something I'll post it here of course.

oanguenot commented 4 years ago

HI, on my side, when I use the version 1.3.6 with the following user agent (Edge): Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36 Edg/84.0.522.40"

I obtain a field manufacturer = null and a field name = "Microsoft Edge".

I thought having manufaturer="Microsoft" and name="Edge".

Is it an issue ?

Thanks in advance

barinbritva commented 4 years ago

@oanguenot, no. It's ok. In previous versions of the library Edge on EdgeHtml was detected as Microsoft Edge. But Edge on Chromium was detected as Chrome. And now it's sometimes Chrome, sometimes Microsoft Edge

P.S.: as I understand, manufacturer is something about exactly hardware manufacturer of device - Apple, Samsung and so on