What is the right way to calculate how much viewable space is available on mobile Safari? By viewing area, we mean the amount of the screen actually available to a web app,
I know this is 5 years old post, but this problem still persists as i can tell. My workaround:
Use a HTML Element on the page which is styled with CSS: .el{ height:100vh; } and retrieve the height in pixel to Javascript by using jQuery: $('.el').height();
If you don't have a practical use for such a element you might create one on the fly for the sole purpose of masuring the viewport:
var vh = $('"').appendTo('body').height();
$('body div:last-child').remove();