Findus23 / devicedetector.net

https://devicedetector.lw1.at
0 stars 0 forks source link

Wrong browser icon #3

Open liviuconcioiu opened 3 months ago

liviuconcioiu commented 3 months ago

Hi @Findus23!

I think there's a bug in the code. If you test with Mozilla/5.0 (Macintosh; U; PPC; en-US; mimic; rv:9.3.0) Clecko/20120101 Classilla/CFM, giving the fact that there's no icon for Classilla (7C), it will automatically add the icon from the first browser under Firefox, which is Arctic Fox (AX).

icon

Same, for Mozilla/5.0 (X11; Linux x86_64; rv:2.0) Gecko/20110318 WebianShell/0.1

Findus23 commented 3 months ago

Hi,

I'll be honest. It has been far too long since I wrote that code for me to understand my reasoning back then. But in the code it is intentionally picking (if nothing better exists) the first icon of the browser family.

I remember that I tried to stay as close as possible to the Matomo code: https://github.com/matomo-org/matomo/blob/ad484fb1868f2276235b417c0009a5547464cda7/plugins/DevicesDetection/functions.php#L121-L128

And checking the latest version of that it still seems to stay with the same concept of taking the first icon of the browser family as a fallback. So I think this is something that instead should rather be changed in Matomo