Skip to content

[Web Install] Distinguish AbortErrors caused by user cancellation #1223

Open

Description

Currently, navigator.install()'s promise can resolve in 1 of 3 ways

  1. Success
  2. AbortError: The user aborted a request.
  3. DataError: The data provided does not meet requirements.

For privacy reasons, AbortError is used as a generic failure code for any non-data related errors. This includes if the user declines the installation dialog.

We should consider changing the message string so that it only says "The user aborted a request" when the user actually clicked "cancel" in the install confirmation prompt.

Motivation - enables developers to show an error message only if something actually failed, and not if the user cancelled installation.

Activity

  1. added
    Web Install API
    on Jan 6, 2026
  2. changed the title [-][Web Install] Add custom error message for user cancellation of install[/-] [+][Web Install] Distinguish AbortErrors caused by user cancellation[/+] on Jan 6, 2026
  3. JudahGabriel commented on Jan 6, 2026

    @JudahGabriel

    We should consider changing the message string so that it only says "The user aborted a request" when the user actually clicked "cancel" in the install confirmation prompt.

    Does that error message change based on browser locale? If so, I'd suggest an alternative that doesn't rely on error message string.

    As a developer I want to do this:

    try {
       navigator.install(url, manifestId);
    } catch (error) {
       // If the user cancelled, log it. Otherwise, show an error to the user.
       const isUserCancellation = ...; // how?
       if (isUserCancellation) {
          telemetry.log("WebInstallCancelled", error);
       } else {
          showErrorInUI(error); 
       }
    }

    Today, I can't reliably do that. I can check if there's a data error, but if it's an AbortError, it could be the user cancelling, or it could be some other problem.

  4. LiaHiscock commented on Jan 8, 2026

    @LiaHiscock
    CollaboratorAuthor

    Judah Gabriel Himango (@JudahGabriel) Ah good point. Sounds like we may actually want separate DOM exceptions then for user cancellation vs other generic failures. Thanks!

  5. cmzz commented on Oct 20, 2026

    @cmzz

    I've been tracking navigator.install() compatibility on [openpwa.net](https://openpwa.net), and there's another issue worth considering: error handling.

    Chrome currently uses AbortError for both user cancellation and certain internal installation failures. The only way to distinguish them is by checking the error message.

    This makes it difficult to collect meaningful installation telemetry. For example, if an installation fails, developers need to know whether the user simply dismissed the dialog or something actually went wrong.

    Relying on error message strings isn't a reliable solution, especially across browser versions.

    I think user cancellation should have its own exception type. It's a normal user decision, not an installation failure, and developers should be able to distinguish the two without relying on string matching.

    I've been documenting the API behavior here:

    https://openpwa.net/reference/installation/navigator-install/

  6. LiaHiscock commented on Oct 27, 2026

    @LiaHiscock
    CollaboratorAuthor

    cmzz - thank you for the feedback! This has been requested by a couple other developers, and we recognize this would help developer usability. While we're not blocking shipping on this, we will definitely re-evaluate as a post-ship followup. Here's the chromium work item if you're curious - https://issues.chromium.org/issues/534847491

    FYI Kristin Lee (@Kbhlee2121) Rob Paveza (@robpaveza) - another request for distinguishing user cancellation abort errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Web Install API

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions