Skip to content

Commit

Permalink
Fix mobile browser detection so that "Desktop mode" works as expected (
Browse files Browse the repository at this point in the history
…openstf#715)

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

Signed-off-by: Ivan Mironov <[email protected]>
Co-authored-by: Karol Wrótniak <[email protected]>
  • Loading branch information
im-0 and koral-- authored Sep 29, 2023
1 parent 3ae296e commit 8c67ff5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions res/app/components/stf/browser-info/browser-info-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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) {
Expand Down

0 comments on commit 8c67ff5

Please sign in to comment.