Last Updated: June 19, 2019
·
21.68K
· mment

hide mobile safari address bar

Want to hide the address bar in mobile safari? Use that

/* iOS re-orientation fix */
if (navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i)) {
    /* iOS hides Safari address bar */
    window.addEventListener("load",function() {
        setTimeout(function() {
            window.scrollTo(0, 1);
        }, 1000);
    });
}