mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 16:13:24 +02:00
Fix all res/ files with ESLint rules with 0 errors.
This commit is contained in:
@@ -10,12 +10,12 @@ module.exports = function BrowserInfoServiceFactory() {
|
||||
service[key] = (typeof test == 'function') ? test() : test
|
||||
}
|
||||
|
||||
addTest('touch', function () {
|
||||
addTest('touch', function() {
|
||||
return ('ontouchstart' in window) || window.DocumentTouch &&
|
||||
document instanceof window.DocumentTouch
|
||||
})
|
||||
|
||||
addTest('retina', function () {
|
||||
addTest('retina', function() {
|
||||
var mediaQuery = '(-webkit-min-device-pixel-ratio: 1.5), ' +
|
||||
'(min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3/2), ' +
|
||||
'(min-resolution: 1.5dppx)'
|
||||
@@ -25,28 +25,30 @@ module.exports = function BrowserInfoServiceFactory() {
|
||||
return !!(window.matchMedia && window.matchMedia(mediaQuery).matches)
|
||||
})
|
||||
|
||||
addTest('small', function () {
|
||||
addTest('small', function() {
|
||||
var windowWidth = window.screen.width < window.outerWidth ?
|
||||
window.screen.width : window.outerWidth
|
||||
return windowWidth < 800
|
||||
})
|
||||
|
||||
addTest('mobile', function () {
|
||||
addTest('mobile', function() {
|
||||
return !!(service.small && service.touch)
|
||||
})
|
||||
|
||||
addTest('os', function () {
|
||||
addTest('os', function() {
|
||||
var ua = navigator.userAgent
|
||||
if (ua.match(/Android/i)) {
|
||||
return 'android'
|
||||
} else if (ua.match(/iPhone|iPad|iPod/i)) {
|
||||
}
|
||||
else if (ua.match(/iPhone|iPad|iPod/i)) {
|
||||
return 'ios'
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return 'pc'
|
||||
}
|
||||
})
|
||||
|
||||
addTest('webgl', function () {
|
||||
addTest('webgl', function() {
|
||||
var canvas = createElement('canvas')
|
||||
if ('supportsContext' in canvas) {
|
||||
return canvas.supportsContext('webgl') ||
|
||||
|
||||
Reference in New Issue
Block a user