0

I love the feature where you can add a site as a homescreen app in iOS, but I have a few questions.

1) A link (<a>) with a href will take you out of the app and open Safari. It's been like this for ages, and still seems to be that way. What's the latest solution to this? Just use javascript and redirect links with window.location instead?

2) Lately it seems like iOS has added a header with a Done button (that takes you back to the start page of the app, which is kind of useless for my purposes), the URL and AA for text size and options. Is it possible with javascript/css/other to remove/hide this header?

3) On the other hand, is it possible to activate a toolbar (or customize the header from point 2 above) with prev/next buttons as well as a refresh button, without creating my own buttons?

4) Added one more point. Is there a way to check if the site is opened in a homescreen app? I know how to check for iOS, but not homescreen app specificly.

SeaBass
  • 1,584
  • 4
  • 20
  • 46
  • 1. You can use window.close() to close a window or tab `window.close()`. 2. No you can not remove this done button, you don't have any control over the browser you only can control your web page. – Ace Nov 16 '19 at 05:53
  • I'm not sure I follow your 1. I don't want to close the window, I just don't want links to open in Safari, I want to stay in my homescreen app. – SeaBass Nov 16 '19 at 05:59
  • then try to redirect your page to the homepage of the safari, but i don't think it will allow you to redirect, like in chrome if you will try to run `window.location.href="chrome://newtab";` it will Prevent it from opening the local url `Not allowed to load local resource: chrome://newtab/` You can try in Safari, may be.I am not sure it will work or not. – Ace Nov 16 '19 at 06:05
  • There are [these solutions](https://stackoverflow.com/questions/2898740/iphone-safari-web-app-opens-links-in-new-window), but all answers are from 2010-2013, so I just wondered if there is any new info on the topic. Especially since Apple added that annoying header when using "javascript links". – SeaBass Nov 16 '19 at 06:11

0 Answers0