!(function(win, doc) { function setFontSize() { var docEl = doc.documentElement; var winWidth = docEl.clientWidth; doc.documentElement.style.fontSize = (winWidth / 375) * 10 + 'px'; } var userAgent = navigator.userAgent; win.addEventListener('resize', function() { if (navigator.userAgent !== userAgent) { location.reload(); } }) setFontSize(); }(window, document));