Specify the URL in html for the bookmark option on iPhone.

I am creating a website optimized for the iPhone, and when people use the + button on the iPhone, you can add a bookmark to the website on the iPhone home screen. How can I specify the URL that will be used instead of the page on which they are located.

For example, if they are located in the URL / Foo / Bar, I want the bookmark to be / Home, so they automatically go to the original URL and do not go from the main page to the site.

Is there any way to achieve this, instead of creating an entire ajax site, so there is only 1 URL.

+3
source share
1 answer

You can update the entry window.historywhen loading the page for any page that you want to save (it can be all of your pages).

window.history.replaceState( '', '', '/Home' );
0
source

Source: https://habr.com/ru/post/1754083/


All Articles