mkeblx / aframe

Building Blocks for the VR Web

Home Page:https://aframe.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix tablet detection issue

mkeblx opened this issue · comments

Fix this issue effecting Samsung tablets.
aframevr#4381

Found some issues with likely both logic for popup and device category (phone/tablet) detection.

Tablet desktop mode:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/11.1 Chrome/75.0.3770.143 Safari/537.36

Tablet mobile mode:
Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-T865) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/11.1 Chrome/75.0.3770.143 Safari/537.36

Difference above is the present of 'Android'. In both cases AFRAME.utils.device.isMobile() returns false, hard to understand exactly what the regex trying to do and not detecting as mobile.

if (/(android|bb\d+|meego).+mob .....)) {
      _isMobile = true;
    }