jenssegers / agent

👮 A PHP desktop/mobile user agent parser with support for Laravel, based on Mobiledetect
https://jenssegers.com
MIT License
4.48k stars 472 forks source link

Mozilla Custom user agent not in Mobile Detect can be misleading [Comment] #202

Open jvrsolis opened 1 year ago

jvrsolis commented 1 year ago

I am not sure what the correct solution is but have a browser named Mozilla isn't the most accurate.

A user agent with for example Mozilla/5.0 only says the browser is Mozilla compatible. It says nothing about it being an actual Mozilla browser unless you mean all browsers that are mozilla compatible you consider to be Mozilla browsers. Many user agents include this "Mozilla/5.0". Mobile Detect rightfully says the browser is unknown because it does not fall in a supported category in many cases but this package says its mozilla when it most likely is not at all related at least to me. For example "Mozilla/5.0 (iPhone; CPU iPhone OS 16_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/20D67 [FBAN/FBIOS;FBDV/iPhone13,2;FBMD/iPhone;FBSN/iOS;FBSV/16.3.1;FBSS/3;FBID/phone;FBLC/en_US;FBOP/5]"

Mobile Detect says the browser is unknown but this package says its Mozilla which means nothing in to end users. At least with unknown we don't mislead users into thinking its something its not or that there is some sort of actual mozilla browser you can go download and it will give this useragent. In reality this user agent string represent the Facebook App 's native in app browser (which is common enough that other user agent parser's label the browser as Facebook App). Again the reality of what it is vs what this package attempts to give can be misleading. At least Mobile Detect recognizes that it currently does not offer more relevant information and gives us an honest and user friendly Unknown. Most or at least a vast majority browsers now a days are mozilla compatible so saying its Mozilla doesn't give any additional information to an end user.

In my opinion we shouldn't have Mozilla as a browser in this package if Mobile Detect truly doesn't know or this packages other additional browser don't cover the case because its misleading and/or confusing at best and wrong at worst.

But wanted to share in case others here did not know that this package is not just a laravel wrapper but an extension with its own opinions that may not be correct for everyone. The inclusion of that "Mozilla" for many "Unknown" mobile detect browsers is one instance of this. To most common end users who see mozilla i can guarantee will think of this being firefox or a non branded firefox browser you can download with unknown at least we get rid of this confusion.