Skip to content
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

Updates definition of install_sources #778

Closed
wants to merge 45 commits into from
Closed

Conversation

diekus
Copy link
Member

@diekus diekus commented Apr 10, 2024

Updates the definition of the install_sources's behaviour to be up to the implementor of the API, and details mechanisms that developers have to tailor the app's distribution to their needs.

diekus and others added 30 commits August 1, 2023 15:43
First review of the install API
Co-authored-by: Amanda Baker <amandaabaker21@gmail.com>
Co-authored-by: Amanda Baker <amandaabaker21@gmail.com>
Co-authored-by: Amanda Baker <amandaabaker21@gmail.com>
Co-authored-by: Howard Wolosky <HowardWolosky@users.noreply.github.com>
Co-authored-by: Howard Wolosky <HowardWolosky@users.noreply.github.com>
updates first examples
Co-authored-by: Amanda Baker <amandaabaker21@gmail.com>
Co-authored-by: Howard Wolosky <HowardWolosky@users.noreply.github.com>
Co-authored-by: Howard Wolosky <HowardWolosky@users.noreply.github.com>
Co-authored-by: Howard Wolosky <HowardWolosky@users.noreply.github.com>
Co-authored-by: Howard Wolosky <HowardWolosky@users.noreply.github.com>
Co-authored-by: Howard Wolosky <HowardWolosky@users.noreply.github.com>
-separates same and cross domain scenarios
-removes canInstall method
-adds optional gating for cross-domain as security measure
-broadens the privacy spectrum where the inquire field is rendered useless
-adds question of letting the UA handle the install/open UI
-sets installability criteria to be defined by the UA
-removes the mode parameter
diekus and others added 13 commits October 11, 2023 18:48
Co-authored-by: Howard Wolosky <HowardWolosky@users.noreply.github.com>
Co-authored-by: Howard Wolosky <HowardWolosky@users.noreply.github.com>
Co-authored-by: Howard Wolosky <HowardWolosky@users.noreply.github.com>
Co-authored-by: Howard Wolosky <HowardWolosky@users.noreply.github.com>
* makes install_sources's default behaviour up to the implementor
@diekus diekus added the Web Install API Declarative install for web apps from a web app. label Apr 10, 2024
Co-authored-by: Howard Wolosky <HowardWolosky@users.noreply.github.com>
Copy link
Member

@amandabaker amandabaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the behavior varies so widely, how will a store be able to know whether it can install an app on the current browser, especially with the movement to freeze the UA string? E.g. Edge/Chrome allow by default, but Brave or DuckDuckGo (being privacy oriented) block by default.

Since we return Success/Failure but not different flavors of failure cases (e.g. the difference between the user cancelling installation vs the user not being able to install the app due to their default install settings) then I could see users getting very confused when the store doesn't indicate to the user why installation repeatedly fails

A new web-manifest boolean key `allow_all_install_sources` signals that the application can be installed from any source. If set to `true`, the `install_sources` list is ignored (if included). If set to `false` or absent, it defers to the origins listed in `install_sources`.
The default behaviour of the cross-origin Web Install API can be to allow installations from any origin or from no origin. *This default is defined by the implementer*. The `install_sources` field in the manifest file specifies detailed origin installation permission allowing finer control by the web app on which origin(s) can install it.

* **Cross-origin installations ON by default**: If the default behaviour is that an origin can be installed from any origin, then any origin can install an app from a different origin. In the presence of an `installed_sources` field, then the default is inverted and only the subset of origins specified in its value can install the app.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* **Cross-origin installations ON by default**: If the default behaviour is that an origin can be installed from any origin, then any origin can install an app from a different origin. In the presence of an `installed_sources` field, then the default is inverted and only the subset of origins specified in its value can install the app.
* **Cross-origin installations ON by default**: If the default behaviour is that an origin can be installed from any origin, then any origin can install an app from a different origin. In the presence of an `install_sources` field, then the default is inverted and only the subset of origins specified in its value can install the app.


* **Cross-origin installations OFF by default**: If the implementer decides to make the default behaviour of cross-origin installations OFF by default, then no third party origin can install the web application. This is the most restrictive case, and the web app conforms to its usual behaviour of only being able to be installed from its same origin. If there is an `install_sources` field present in the manifest file, then only the specific set of origins specified in that value can install the app.

In both cases, the `install_sources` field overrides the default behaviour adopted by the UA and allows only the specified origins to installed the application.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In both cases, the `install_sources` field overrides the default behaviour adopted by the UA and allows only the specified origins to installed the application.
In both cases, the `install_sources` field overrides the default behaviour adopted by the UA and allows only the specified origins to install the application.

To ensure that the developer can have control of where their app can be installed from independent of the implementors default behaviour, a new web-manifest boolean key `allow_all_install_sources` can tell the UA that the application can be installed from any or no other origin.

* if set to `true`, the `install_sources` list is ignored (if included) and the app can be installed from any origin.
* if set to `false`, the `install_sources` list is ignored (if included) and the app can be installed only from the same-origin it is hosted.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the case where the browser allows install by default, but the developer only wants to allow a few vetted stores to install? This would block that scenario.

What about:

Suggested change
* if set to `false`, the `install_sources` list is ignored (if included) and the app can be installed only from the same-origin it is hosted.
* if set to `false`, the `install_sources` list is respected (if included) and the app can be installed only from the origins listed in `install_sources` or the same-origin it is hosted.

Copy link
Member

@amandabaker amandabaker Apr 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chatted offline. Diego's suggestion was to change this to discuss the order of precedence:

  1. install_sources (if provided the UA assumes the dev wants to block by default)
  2. allow_all_install_sources
  3. UA default behavior of allow or block by default.

@amandabaker
Copy link
Member

Chatted offline. WRT my comment around browsers behaving differently, Diego pointed out that devs will already need to handle error cases, so for the scenario described above, the store can decide that, after a certain number of failed installations, it should prompt the user to navigate to the site and try to install it themself. Plus, if most browsers decide to allow by default, then this is a non-issue

Copy link
Member

@amandabaker amandabaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be good to add a sample of how to combine allow_all_install_sources with install_sources but we can do that as a follow up.

Copy link
Member

@amandabaker amandabaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rejecting in favor of #793

@amandabaker
Copy link
Member

Abandoning in favor of #793

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

Successfully merging this pull request may close these issues.

3 participants