Fix mobile browser detection so that "Desktop mode" works as expected (#715)

Currently, enabling the "Desktop site" mode in Chrome on Android does
nothing to the stf interface.

Signed-off-by: Ivan Mironov <mironov.ivan@gmail.com>
Co-authored-by: Karol Wrótniak <karol.wrotniak@droidsonroids.pl>
This commit is contained in:
Ivan Mironov
2023-09-30 01:39:52 +02:00
committed by GitHub
parent 3ae296e30c
commit 8c67ff5c21

View File

@@ -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) {