Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove Address Bar in Safari in iOS?

Old trick with window.scrollTo(0,1); doesn't work. And even worse, the address bar moves only a bit and gets stuck halfway out sometimes.

like image 733
firedev Avatar asked Oct 25 '11 13:10

firedev


People also ask

How do I get rid of the address bar in Safari?

Enter full screen mode, right-click anywhere around the address bar then click "Hide Toolbar" in the menu that appears. Although next time you enter full screen mode the toolbar comes back.

How do I hide the address bar in Safari iOS 15?

Remove the Tab Bar from Safari Landscape ViewOpen the Settings app. Tap Safari. Tap the toggle next to Landscape Tab Bar to disable it.


1 Answers

It is a combination of many things as I have found when researching this issue for myself. Here's the code that properly works on iOS5: (I know I'm a little late, but an answer is an answer, hopefully it can help people in the future)

<!DOCTYPE html>
<html>
<head>
<title>Hide Address Bar</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script>
 window.addEventListener("load",function() {
   setTimeout(function(){
    window.scrollTo(0, 0);
    }, 0);
 });
</script>
<style>
 body { min-height: 480px; }
</style>
</head>
<body>
 <h1>Content</h1>
</body>
</html>

Source: http://24ways.org/2011/raising-the-bar-on-mobile

Example: http://jsbin.com/isenax/

like image 115
Jon Dolan Avatar answered Oct 06 '22 06:10

Jon Dolan