From 8c67ff5c21cc89e3a0fdf011fa8a529dbb88474c Mon Sep 17 00:00:00 2001 From: Ivan Mironov Date: Sat, 30 Sep 2023 01:39:52 +0200 Subject: [PATCH] Fix mobile browser detection so that "Desktop mode" works as expected (#715) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently, enabling the "Desktop site" mode in Chrome on Android does nothing to the stf interface. Signed-off-by: Ivan Mironov Co-authored-by: Karol Wrótniak --- .../components/stf/browser-info/browser-info-service.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/res/app/components/stf/browser-info/browser-info-service.js b/res/app/components/stf/browser-info/browser-info-service.js index f166772d26..e1ec2ab790 100644 --- a/res/app/components/stf/browser-info/browser-info-service.js +++ b/res/app/components/stf/browser-info/browser-info-service.js @@ -31,10 +31,6 @@ module.exports = function BrowserInfoServiceFactory() { return windowWidth < 800 }) - addTest('mobile', function() { - return !!(service.small && service.touch) - }) - addTest('os', function() { var ua = navigator.userAgent if (ua.match(/Android/i)) { @@ -48,6 +44,10 @@ module.exports = function BrowserInfoServiceFactory() { } }) + addTest('mobile', function() { + return !!(service.small && service.touch && (service.os !== 'pc')) + }) + addTest('webgl', function() { var canvas = createElement('canvas') if ('supportsContext' in canvas) {