1

Is there a JS event that gets triggered if a user closes Safari on their iPhone? onunload works if a person leaves a page, but is not called when the browser is closed.

My hunch is, no, there is no event triggered, as closing Mobile Safari merely 'minimizes' it rather than actually closes it. Can anyone confirm?

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
DA.
  • 39,848
  • 49
  • 150
  • 213
  • fond your answer here: http://stackoverflow.com/questions/4940657/handling-standby-on-ipad-using-javascript/4941098#4941098 – Billy Moon Apr 05 '11 at 15:41
  • @Billy That answer isn't explicitly stating that there isn't an available event, though it seems to be hinting at that. – DA. Apr 05 '11 at 15:49
  • I looked into this a while ago, and did not come up with anything better than that answer. I found many answers that say the same thing more or less. The problem is that Apple don't often tell you exactly the whole story - there are lots of undocumented APIs, and differences between different hardware and iOS versions etc... getting a concrete answer on things like this is very difficult. I put the link in comments - not as an answer, as I am not answering positively, just that I think that link is most likely going to be the best answer to your question which is a duplicate of that question. – Billy Moon Apr 05 '11 at 16:14
  • Well, isn't that other question asking about webviews within an actual app? I'm focusing on mobile safari, standalone--In the context of a web page. – DA. Apr 05 '11 at 17:37

1 Answers1

0

Not exactly, but look in the comments for the pagehide event: What event fires when a WebKit WebApp is "terminated"

Community
  • 1
  • 1
fregante
  • 29,050
  • 14
  • 119
  • 159