-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Control the default behavior at the moment of completion of the installation #995
Comments
This sounds like it might be a chrome bug/behavior? |
(I read the spec roughly. This behavior is not defined in the spec.)
It depends on how to solve the problem.
On desktop OS, I think chrome's current behavior is inappropriate. But developers have a workaround for it:
|
Hm, that would false trigger in the following circumstances, but that might be wanted by the developer?
But I think this is also, in a way, yes a feature of chrome. We re-parent the window contents, so that any current state is saved (all form controls, editing, etc). So yeah - not sure how much of this is spec-land vs user-agent-land feature requests. But I could see a feature request about giving web apps more control over exactly what happens on install (what page is loaded). Not sure about privacy implications though... could make an easy fake windows login prompt |
Yes, that workaround code is only used in pages that should never be opened in the (standalone display mode) app. To better understand, I made a simple PWA example, https://webvideoplayer.org/ . After installation from homepage(index.html), chrome load index.html into the app, and the workaround code change the page to player.html (the app itself). The code is only used in index.html, not in player.html.
Yes, that’s what I filed this issue is about. |
Circling back - this should be possible to detect with the 'onappinstalled' event in Chrome, at which you can navigate the page. In Safari - the start_url always loaded on launch after install I believe, so this isn't an issue there. @hanguokai does that approach work for you? |
Yes, this is the behavior I expect in my use case.
I read the chrome official article 2 years ago. But I didn't realize that this is a cancelable event from the article. Do you mean I should call the
If so, after installation, I would like to turn the install button into the launch button, just like after installing an Android app in Google Play. |
(I originally posted this at manifest-incubations, then @dmurph suggested to post it here)
Currently, after installation of a PWA app, Chrome loads current page into the app automatically. But not all web pages in the origin should be loaded into the app. For example, the landing page of the app introduce the application and show an install button. After installation, the app should be launched with it's start_url, not current visited url.
The website should be able to control the default behavior after installation. For example:
The text was updated successfully, but these errors were encountered: