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.55k stars 2.68k forks source link

Bad detection for recent Xiaomi browser #901

Closed benland2 closed 1 year ago

benland2 commented 2 years ago

The following user agent of Xiaomi mobile is detected as PC:

Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/89.0.4389.116 Safari/534.24 XiaoMi/MiuiBrowser/12.13.2-gn

serbanghita commented 2 years ago

@benland2 problem here is that besides XiaoMi/MiuiBrowser/12.13.2-gn part, there is no indication of what type of device this is. Is this the browser https://play.google.com/store/apps/details?id=com.mi.globalbrowser&hl=en&gl=US ? If this is only on mobile devices then I can add it to the list of mobile browsers

darapa1 commented 2 years ago

@serbanghita @benland2 The mentioned UA string is from Desktop Mode of the Xiaomi Browser. Running in normal mode (default after installation on my mobile phone) will detect isMobile() = true and isXiaomi() = true.

The normal (default configuration of the browser) is fully covered by current versions of MobileDetect.

benland2 commented 1 year ago

OK it means that my related user has enabled the Desktop Mode on his browser. Thank you for your investigation.