IOS 6, safari fullscreen webapp, home button

江枫思渺然 提交于 2019-12-07 05:19:13

问题


I'm developping a webapp (javascript) to put on the homescreen of the iPad to be able to run it in fullscreen mode. Everything is working but after a random while, the home button doesn't work anymore. But the app still continuing to run, and the is no bug at all. I still can run javascript functions in the console with safari on my mac, alert, prompt, and all of those stuff are working. but not window.close(); To quit the application I have to restart my device by pushing the switch off button and the home button.

If anyone can help me to figure out what it is I would be very happy.


回答1:


The SoundJS team has tracked this issue down to the web app entering full screen mode using:

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

A bug was reported to apple (reference #15133492).

Currently we have no work around except not entering full screen mode.




回答2:


I had the same problem and after some debugging I discovered it came from alert, confirm or prompt native box.

After displaying one of those native box in a particular situation (not every ones are true), hardware home and lock buttons won't work anymore.

In my situation, confirm() box was called inside an onclick event with setTimeout like this:

var btnCallback = function() { setTimeout(function() { callback(/*var answer = confirm('');...*/); }, 1); }

You should remove calls to these kind of dialog windows and prefer using homemade ones.

Tested on iPhone 4 with iOS 6.1.3.

Hope it helps.

EDIT

It could also come from blocking javascript portion of code (like confirm behavior when showed or large amount of code processing).

This is only supposition.

EDIT 2

After other tests, the problem seems to still be there. All I do is using google maps API v3 and displaying div from current URL hash.

No page reload, just javascript and window location hash manipulation.

I don't understand where does it come from.



来源:https://stackoverflow.com/questions/16979274/ios-6-safari-fullscreen-webapp-home-button

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!