How to prevent the address bar in mobile safari from overlapping the top of the page?

46 views Asked by At

First of all, I have the address bar at the top of my mobile Safari.

If I open a long page and scroll down, the address bar and toolbars will disappear (normal viewport will become a large viewport). If I click some link on the page, the address bar will reappear (the large viewport will go back to the normal viewport), then a new page will be loaded. This is normal behavior; the page loads inside the "normal viewport", and the window.scrollY is 0.

However, if the new page loads too quickly, it will load inside the large viewport of the current long page and only then the address bar will appear. In this case, the address bar won't push the content of the page, but will cover the top of the loaded page, for the user it will look like if the content of the page has been scrolled slightly to the top, window.scrollY won't be 0.

Is there a way to load prevent fix this behaviour? I don't want to scroll the page down all the time to see what content is hidden under the address bar.

PS. I know I can make toolbars always visible, this will kind of fix the problem, but will "shrink" the visible area of the page (I want to avoid this).

0

There are 0 answers