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

Samsung Tablets no longer detected #926

Closed ForsakenNGS closed 1 year ago

ForsakenNGS commented 1 year ago

Issue description Since a few days ago Samsung Tablets are no longer detected properly. It seems they removed the model number from the user-agent as seen below. The tablet tested here is a Samsung Tab S7+.

User-Agent(s) Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36

Suggestions As a workaround I appended |Android.*Chrome/[.0-9]* Safari/[.0-9]* to the GenericTablet rule, which classifies all android devices sending e.g. Chrome/112.0.0.0 Safari/537.36 instead of Chrome/112.0.0.0 Mobile Safari/537.36 (no Mobile) as a tablet. I don't know if there are devices or edge-cases which this will break, but it is the only workaround I could figure out.

darapa1 commented 1 year ago

@ForsakenNGS Same with unknown (brand new tablets) until they added weeks or month later to the project.

Just add this to the end of your GenericTablet section: |^(?!.*Mobile).*Android.*$ This will make every "Android" device which does not have "Mobile" in its UA-string to a tablet.

Suleman-Elahi commented 1 year ago

Same Motorola. It only displays Android 10 K

serbanghita commented 1 year ago

@ForsakenNGS @darapa1 @Suleman-Elahi it's part of the Google's user-agent reduction plan

See https://developer.chrome.com/blog/user-agent-reduction-android-model-and-version/

Suleman-Elahi commented 1 year ago

Can you tell how this one is still functioning: https://www.deviceinfo.me/

@serbanghita