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
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
f03fa42
First review of the Install API
diekus Aug 1, 2023
b603fe2
Update explainer.md
diekus Aug 1, 2023
4ea9104
Update explainer.md
diekus Aug 9, 2023
97fe399
Update WebInstall/explainer.md
diekus Aug 10, 2023
bc00fe2
Update WebInstall/explainer.md
diekus Aug 10, 2023
fea1300
Update WebInstall/explainer.md
diekus Aug 10, 2023
22bf14a
Update explainer.md
diekus Aug 10, 2023
6bad763
Merge branch 'main' of https://github.com/diekus/MSEdgeExplainers
diekus Aug 10, 2023
71950f0
Update WebInstall/explainer.md
diekus Aug 14, 2023
8bddf7f
Update WebInstall/explainer.md
diekus Aug 14, 2023
f101666
Update explainer.md
diekus Aug 15, 2023
7ffbf7d
Adds image that shows the errors of the promise
diekus Aug 15, 2023
9d12a63
Update explainer.md
diekus Aug 15, 2023
19015ca
Update explainer.md
diekus Aug 18, 2023
3aa0ad5
Update explainer.md
diekus Aug 21, 2023
d720353
Update explainer.md
diekus Aug 21, 2023
409170a
Update explainer.md
diekus Aug 21, 2023
1d709f2
updates the promise resolution image
diekus Aug 21, 2023
0ec8246
Update WebInstall/explainer.md
diekus Aug 22, 2023
6a0486b
Update explainer.md
diekus Aug 22, 2023
7df8857
Update explainer.md
diekus Aug 22, 2023
bbd16dc
Update WebInstall/explainer.md
diekus Aug 23, 2023
1a2603a
Update WebInstall/explainer.md
diekus Aug 23, 2023
9136af2
Update WebInstall/explainer.md
diekus Aug 23, 2023
6b18446
Update WebInstall/explainer.md
diekus Aug 23, 2023
e7c5bd1
Update WebInstall/explainer.md
diekus Aug 23, 2023
5af1533
Merge branch 'MicrosoftEdge:main' into main
diekus Oct 2, 2023
7f998f5
Post TPAC/TAG review mega first draft
diekus Oct 4, 2023
800a7e2
explainer landing page
diekus Oct 5, 2023
0a4ec42
Update explainer_cross_domain.md
diekus Oct 9, 2023
ad09a50
-post TPAC review of the web install api
diekus Oct 11, 2023
666c58c
Merge branch 'MicrosoftEdge:main' into main
diekus Oct 11, 2023
088cd17
Updates explainers with further review
diekus Oct 12, 2023
e002184
Merge branch 'MicrosoftEdge:main' into main
diekus Oct 30, 2023
d19cc46
Update WebInstall/explainer_same_domain.md
diekus Oct 30, 2023
12d643d
Update WebInstall/explainer_same_domain.md
diekus Oct 30, 2023
5330157
Update WebInstall/explainer_same_domain.md
diekus Oct 30, 2023
7b014e7
Update WebInstall/explainer_cross_domain.md
diekus Oct 30, 2023
f7c3b2b
Posy TPAC
diekus Oct 30, 2023
30b4137
Posy TPAC
diekus Oct 30, 2023
a03705b
Merge branch 'MicrosoftEdge:main' into main
diekus Jan 3, 2024
03f76a5
Merge branch 'MicrosoftEdge:main' into main
diekus Mar 25, 2024
55c23d4
Updates `install_sources` definition
diekus Apr 10, 2024
3d72100
Update WebInstall/explainer_cross_domain.md
diekus Apr 10, 2024
346a751
Update explainer_cross_domain.md
diekus Apr 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 32 additions & 9 deletions WebInstall/explainer_cross_domain.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,27 +172,50 @@ switch (state) {
break;
}
```
#### **Install Sources manifest field**
* A new field called `install_sources` will be added to the manifest file to have a control list of sites that can install the app. In its most restrictive case, the developer can specify to not allow installation from any other origin, in which case the PWA conforms to its usual behaviour of only being able to be installed from its same origin.
#### **Controlling default installation sources**

The default behaviour of a UA for 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*. An implementer may choose to:

* ALLOW cross-origin installations by default.
* DENY cross-origin installations by default.

This affects if an origin must be listed in the `install_sources` of an app to be able to install it.

##### Overriding the default UA behaviour

A developer can have full control of where their app can be installed from, independent of the implementor's 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. This overrides the default implementation by the UA.

* if set to `true`, then cross-origin installations can enabled by default.
* if set to `false`, only same-origin installations are allowed, unless the invoking installation-origin is listed in the application's `install_sources`.

```json
{
"name": "Awesome PWA",
"display": "standalone",
"start_url": "/index.html",
"allow_all_install_sources": "true"
}
```

##### Fine tuning installation sources for an application

In both cases of the default UA behaviour, developers can use the `install_sources` manifest field to have fine control over which specific origins can or can't install the application.

##### Allowing installations from any origin
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`.

```json
{
"name": "Awesome PWA",
"display": "standalone",
"start_url": "/index.html",
"install_sources": [
{"origin": "apps.microsoft.com"},
{"origin": "store.app"}
{"origin": "https://apps.microsoft.com", "action": "allow"},
{"origin": "https://store.app", "action": "allow"}
{"origin": "https://anotherstore.com", "action": "deny"}
]
}
```

This new manifest field will protect the app from being listed in undesirable repositories and give the developer absolute control about where do they want the PWA to be installed from. At best, the developer can allow the PWA to be installed from any site ("`*`"), at its most restrictive, it can only allow installing from the app's same scope. This field is only for the JS API and does not interfere with existing ways of installing PWAs through mechanisms like enterprise policies.

If no `install_sources` are present in the manifest file, the default should be to not allow an app to be installed from cross-origin sites.
This field is only for the JS API and does not interfere with existing ways of installing PWAs through mechanisms like enterprise policies.

#### **Gating capability behind installation**
A UA may choose to gate the `navigator.install` capability behind a requirement that the installation origin itself is installed. This would serve as an additional trust signal from the user towards enabling the functionality.
Expand Down