hide mobile browser address bar on chrome (android)

后端 未结 3 822
后悔当初
后悔当初 2020-12-11 06:33

We have a site, where with a simple JavaScript


We hide the ad

相关标签:
3条回答
  • 2020-12-11 06:59

    scrollTo(0,1) is not yet supported in Chrome for Android (it was recently added and then removed). We do have the FullScreen API but that is a little heavy handed for what you want to achieve.

    0 讨论(0)
  • 2020-12-11 07:18

    I found the way how to hide address bar after first click

    if (document.body.webkitRequestFullScreen) {
      window.addEventListener('click', function(e) {
        if (e.target.type != 'text' && e.target.type != 'password') {
          body.webkitRequestFullScreen();
          window.setTimeout(function() {
            document.webkitCancelFullScreen();
          }, 500);
        }
      }, false);
    }
    
    0 讨论(0)
  • 2020-12-11 07:19

    Seems that the latest update of Chrome Mobile (July 22) broke the toolbar auto-hide feature. When scrolling down a page, the toolbar no longer auto-hides. This was the case on my Nexus 4.

    July 22 update brings full screen mode for tablets. But i guess they accidentally broke the feature for smartphones. Full screen mode was working previously on smartphones.

    Chrome Browser Play Store

    0 讨论(0)
提交回复
热议问题