mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 16:13:24 +02:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user