Web - Add to Home Screen not maintaining current page - javascript

I'm building a web app which has a login page that I've added a script to allow the user to Add to Home Screen and it opens up fullscreen without the safari toolbars.
However once you pass the first page (login screen) and go to any other screen, if you press the home button and put the app to the background and then re-enter, it kicks you back out to the first login page.
Could anyone shed some light on what is happening there?
Thanks.

Related

How to redirect to another site automatically in Next.js

I am trying to make my progressive web app automatically redirect to another site when the user clicks on the icon on their desktop.
As of right now when the user clicks on the icon it opens up a landing page where the user can link on the link to be redirected.
I'm using Next.js and JavaScript. I appreciate any help you can give me.

In mobile Safari, website added to Home screen, shows gray bars on the top and bottom when navigating pages, how to make it full screen?

I have a multi page website. I add it to home screen in iPhone using "add to home screen" button in Share menu.
When I open it using the icon in the home screen, the website shows full screen. But when I go to any sub-page with a different route, like example.com/page, I see gray bars at the top and bottom, showing the address, navigation back and forward, "Done" button, share button, open in safari button.
How can I make it display full screen all the time?
Changing routing to use # is not an option.
It worked at some point in the past, but I had to remove the app, and can't make it work again
I figured it out myself, it turns out that recently I removed manifest.json from the html file. Adding it back solved the problem!
Also, I found this page helpful in figuring out how manifest works https://web.dev/add-manifest/

Android/iPhone “Add to Home Screen” url customization

I have a website and when user adds it to home screen, it saves current url.
For example: if user is on example.com/categories page, application will save this url and when user opens application from home screen, it will opens example.com/categories.
I want to customize it in such a way that when user saves to home screen, starting page always was home page (example.com)
How can I achieve it ? is it possible?

How to poll for the back button in a Javascript Windows 8 App?

I'm trying to incorporate page navigation in my Windows 8 app. I have two pages right now and I am able to go from the home page to the beginning page. There is a different background for both pages. When I navigate from the home page to the beginning page, the background changes, but when I press the back button, the background is still the beginning page background and not the home page background. I need to be able to poll for the Windows 8 built in back button so I can reload the home.html file that I have. How would I go about doing this?
The WinJS.Navigation namespace has a canGoForward and canGoBack allow you to detect this state.
You could also update your implementation of the navigation implementation to change that background.

Mobile Landing go back no redirection

I'm trying to make a web page that redirects to a mobile land page. It works, but on the mobile land page I want to go to the main page without using redirection but, of course, each time I go to the main page, it redirects me to the mobile land page (of course, as the script runs...).
So my question is: how can I link the mobile land page to the main page without redirecting when I link to it?
You could add a parameter on the url to the main page on the mobile site eg:
Go to full site
Then on the main page check if the parameter exists before redirecting.
var mredirect = getParameterByName("mredirect");
if(!mredirect && isMobile){
//redirect to mobile site
}
getParameterByName : How can I get query string values in JavaScript?

Categories