On iPhones with iOS 15, the address bar is at the bottom of the screen (default) or optionally at the top of the screen.
Is there any way to determine the position (bottom or top) of the address bar with JS?
On iPhones with iOS 15, the address bar is at the bottom of the screen (default) or optionally at the top of the screen.
Is there any way to determine the position (bottom or top) of the address bar with JS?
Copyright © 2021 Jogjafile Inc.
Short Answer: No
Explanation:
The reason that you cannot find the location of the address bar is because it is outside of the website.
What this means:
The website is one container, and JS can only assess things inside of the website container. The address bar is another container.
So why does this exist?
This is here to stop malicious websites from accessing your address bar (or something else) and typing in a link. At first you might think this is the same as a redirect, but it doesn't stop at the address bar. What if it had the ability to change your settings and auto download something?
What are the workarounds?
You can display a prompt for the user to ask where the address bar is, however, there really isn't much you can do.
If you can tell us the reason for wanting to location, maybe we can find a workaround!