Skip to content

[Web Install] Defining app already installed promise resolution behavior #1044

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

Open
LiaHiscock opened this issue May 21, 2025 · 2 comments
Open
Assignees
Labels
Web Install API Declarative install for web apps from a web app.

Comments

@LiaHiscock
Copy link

Currently, the Explainer says if the app is already installed, the User Agent can decide how to handle this, and "for example", the promise can resolve with kSuccess if the app launches, and kAbort if it doesn't.

  1. We should clarify that the user agent is only in control of the UX behavior in this case (ie. showing a dialog).
  2. The promise resolution should be clearly defined by the spec.
  3. The promise should resolve with kSuccess if the app is installed, independent of whether it launched, or the dialog was shown, etc. (This prevents the developer from knowing whether the app was previously installed)
@LiaHiscock LiaHiscock added the Web Install API Declarative install for web apps from a web app. label May 21, 2025
@LuHuangMSFT
Copy link
Contributor

LuHuangMSFT commented May 28, 2025

There is a concern about revealing install status to a page without any user prompt or confirmation. The page may have misled the user into making the user action that initiated the navigator.install call.
 
If getInstalledRelatedApps allows a page to know if the app it is in scope of is installed without any user prompts, the above concern is moot. For the current-document install scenario where the app is already installed, we could just let the navigator.install's promise resolve with the information that the app is installed without any further user confirmation.

For the case where the page is installing an app it cannot detect with getInstalledRelatedApps, we should require user confirmation.

@diekus
Copy link
Member

diekus commented Jun 3, 2025

After much deliberation about how installations work on webkit and chromium I think we should keep the current behavior, this is:

  • if an app is not installed, the API installs and resolves if the installation goes through and rejects if the user cancels or there is an error.
  • if an app is installed, then:
    • resolves if the user opens the app (chromium) or names and (re) installs the app (webkit)
    • rejects if the open prompt or (re) installing prompt is closed or aborted.

Thanks also @christianliebel for helping arrange some thoughts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Web Install API Declarative install for web apps from a web app.
Projects
None yet
Development

No branches or pull requests

3 participants