var initBtnChk = null; var selfLocation; initBtnChk = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]; selfLocation = 'https://cube.wgo.ru'; isTouch = getIsTouch(); checkScreen(); function getIsTouch(){ let isTouched = ("ontouchstart" in window || navigator.msMaxTouchPoints) !== undefined; return (isTouched); } async function checkScreen() { if(isTouch !== Boolean(initBtnChk[15])){ initBtnChk[15] = Number(isTouch); try { const response = await fetch(selfLocation + "/ajax/session-write", { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded", "X-Requested-With": "XMLHttpRequest" }, body: "initBtnChk=" + initBtnChk, keepalive: true, }); if (response.ok) { responseText = await response.text(); window.location.replace(selfLocation); } } finally {} } }