1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-12-05 10:18:38 +09:00
tamaina 2019-05-29 20:44:20 +09:00 committed by Satsuki Yanagi
parent 788edd3622
commit 22c4842154
No known key found for this signature in database
GPG Key ID: 889CA74CC28378D0

View File

@ -84,9 +84,14 @@
// Detect the user agent
const ua = navigator.userAgent.toLowerCase();
const isMobile = settings.device.appTypeForce === 'mobile' ||
(settings.device.appTypeForce !== 'desktop'
&& (/mobile|iphone|ipad|android/.test(ua) || window.innerWidth < 576));
let isMobile = /mobile|iphone|ipad|android/.test(ua) || window.innerWidth < 576
if (settings && settings.device.appTypeForce) {
if (settings.device.appTypeForce === 'mobile') {
isMobile = true
} else if (settings.device.appTypeForce === 'desktop') {
isMobile = false
}
}
// Get the <head> element
const head = document.getElementsByTagName('head')[0];