When a user launches "new window" in a home screen app
Asked Answered
C

2

6

When a user launches "new window" link in a home screen app.

In Mobile Safari this type of action would open a new tab. What happens if the app is on the home screen and has name="apple-mobile-web-app-capable", content="yes" active.

Will the window still technically be in another tab, although you cant get back to the original one - or will it just navigate within the current tab?

Copperplate answered 10/11, 2011 at 21:28 Comment(0)
S
1

First of all, unfortunately window.open method does not work at all.
Instead, a < a href="..". >...< /a > works and by default launches Safari and opens the link in a normal browser window (so, if the user wants to come back to the app, he has to doubleclick the iPad key and switch back to it).
You can force the link to open inside the app (so replacing the current page) with the tricks listed here: iPhone Safari Web App opens links in new window

Spirometer answered 27/11, 2011 at 1:58 Comment(6)
My links open in the same app window, just dont know if they leave behind an 'open' tab/window.Copperplate
Tested right now in iPad1 with iOS 5.0.1: in my webapp (and I mean an app that has been added to the home and so opened by clicking on the home link at fullscreen), if I click on a link, Safari is launched and the link is opened in a Safari tab.Spirometer
I didn't say it was default behavior... You're not very helpful.Copperplate
Have the same problem and cannot find a good solution anywhere. On my Ipad iOS7 the window.open opens the window (originally meant as a tab) in the same window on home screen use. This is good but from there there is no way back :(Galloon
@Garavani: I guess you could then create an iframe and using that as the target for the link. Then you would have control (you could show/hide the iframe and close it when you're done without affecting the parent content).Spirometer
Yes, the iframe solution works. But I wouldn’t like to change the basis of my site just in case of home screen use. I will try to look for browser history solution but I don’t know if this will work with a replaced window content. I have to read and learn about it… Thanks anyhow for commentGalloon
S
0

Hei, I found a brilliant way to have a "window.open" effect in an iOS webapp too! It loads a page in a Safari tab and has solved my problem, maybe it can be useful to others: http://webdeveloper.com/forum/showpost.php?p=1161159&postcount=14
It's also a great way to avoid the popup blocker (the blocker would stop a window.open(url) call but it doesn't stop that method) :-)

Spirometer answered 27/11, 2011 at 17:43 Comment(2)
I don't want a window.open effect.Copperplate
I clearly wrote what it is. This topic is titled "When a user launches new window in a home screen app", so I'm sure that it will be useful for other people, even though it's not useful to you. Demonstration: I solved my problem with it, and when I was looking for resources about my problem I came exactly to this question.Spirometer

© 2022 - 2024 — McMap. All rights reserved.