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.

Home Page:http://mobiledetect.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not Work Properly

hafizulshaikh42 opened this issue · comments

Please specify the User-Agent. Go to https://demo.mobiledetect.net and copy-paste it here.
This projects does not get proper value.

It only doesn't work in Chrome based browsers. Works file in MS Edge and DuckDuckGo

commented

Doesn't detect Chrome:
https://demo.mobiledetect.net/ shows:
This is a computer. Your UA is Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36

Doesn't detect Safari:
This is a computer. Your UA is Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.5.2 Safari/605.1.15

Doesn't detect Firefox:
This is a computer. Your UA is Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/110.0

Doesn't detect Edge:
This is a computer. Your UA is Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.82

All is.. functions are false and isChrome(), and isSafari(), etc

@hafizulshaikh42 @Suleman-Elahi @photocoder the reason why it detects false is because the library only looks for "mobile" versions of Chrome. The library is not meant to detect regular desktop versions.

Also see: https://github.com/serbanghita/Mobile-Detect/blob/3.74.x/docs/KNOWN_LIMITATIONS.md