selwin / python-user-agents

A Python library that provides an easy way to identify devices like mobile phones, tablets and their capabilities by parsing (browser) user agent strings.
MIT License
1.43k stars 196 forks source link

Wrong browser family returned for Edge #105

Closed potasiak closed 3 years ago

potasiak commented 3 years ago

Version: 2.0

For users using MS Edge based on Chromium engine, instead of the Edge browser family, we get Chrome. Currently only confirmed that for Edge 86; we're not sure how far back the issue goes.

Example:

>>> import user_agents
>>> ua = user_agents.parse('Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36 Edg/86.0.622.58')
>>> ua.browser
Browser(family='Chrome', version=(86, 0, 4240), version_string='86.0.4240')

You can check the user agent string:

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

on https://developers.whatismybrowser.com/useragents/parse/ where it is parsed properly as Edge 86.

potasiak commented 3 years ago

Turns out, the issue is fixed in the 2.2.0 release.