开发者

Web app in full screen mode on Ipod

I have a web app I'm building a mobile site for. I'm trying to run it in full screen without a nav bar if the user has added the page to their home screen.

Right now, my javascript is very simple:

if (navigator.standalone) {
    alert ('From Home Screen');
} else {
    alert ('From Browser');
}

All I want to check to see is if I can detect whether or not the user has added the app to their home screen. With the code above, even after 开发者_如何学编程adding the app to the home screen, the app is only ever being caught by the else statement.

Looking through apple's documentation, I found this goody:

<meta name="apple-mobile-web-app-capable" content="yes" />

Adding that code to my didn't seem to do a thing. I still cannot get the site to go into fullscreen mode, or alert it as standalone.


That meta tag is (apparently) processed when the link is added to the home screen. So, if you added it to your home screen before adding the meta tag, it will have no effect.

Try removing the icon from your home screen and adding it again.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜