-
Notifications
You must be signed in to change notification settings - Fork 213
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
Require id in manifest and support 0 param installation #894
base: main
Are you sure you want to change the base?
Require id in manifest and support 0 param installation #894
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some things to consider. Given the additional changes you're making here to essentially require id
to be in the manifest for any same-origin installed app, I question if a 2-param signature still makes sense.
@@ -72,7 +72,7 @@ When called on the same domain, the **`install` method will trigger/open the pro | |||
|
|||
### The `navigator.install` method | |||
|
|||
To install a web site/app, the site/app would use the promise-based method`navigator.install(<id>[[, install_url], <params>])`. This method will: | |||
To install a web site/app, the site/app would use the promise-based method `navigator.install(id, install_url, [<params>])`. This method will: | |||
|
|||
* Resolve when an installation was completed. | |||
* The success value will be an object that contains: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the id
"computed" at this point? Based on this design, web install no longer permits the usage of computed ids, only explicitly defined id's declared in the manifest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to update 2. below ~100 to say "computed or id in manifest"
@@ -72,7 +72,7 @@ When called on the same domain, the **`install` method will trigger/open the pro | |||
|
|||
### The `navigator.install` method | |||
|
|||
To install a web site/app, the site/app would use the promise-based method`navigator.install(<id>[[, install_url], <params>])`. This method will: | |||
To install a web site/app, the site/app would use the promise-based method `navigator.install(id, install_url, [<params>])`. This method will: | |||
|
|||
* Resolve when an installation was completed. | |||
* The success value will be an object that contains: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't add a comment lower, so putting it here. I encourage you to open an Issue tracking that there's a single error that is just AbortError. I think it would be helpful to devs if there was at least one other error that helped identify that the problem was that a id
was either not found, or the one specified in the call didn't match the one in the target manifest.
WebInstall/explainer_same_domain.md
Outdated
1. `navigator.install(id[[, install_url], <params>])`: The method takes an id (and optional install url) and tries to install the current origin. If the content being installed has a manifest file, this `id` must match the value in the manifest file. If there is no manifest file present, this `id` will act as the app id for the installed content. This is relevant since if the installed content were to be given a manifest file and made into an application, there is a way to automatically update the app going forward. | ||
The call can also receive an object with parameters that it can use to customize a same domain installation. These parameters alter how the app is installed and are defined in an object. More information about the parameters is found in the [Parameters](#parameters) subsection of this specification. | ||
1. `navigator.install()`: The method takes no parameters and tries to install the current document. If the content to be installed does not link to a manifest with a valid id, then installation will fail. | ||
2. `navigator.install(id, install_url, [<params>])`: The method takes an id and install url and tries to install the web content at `install_url`. If the content to be installed does not have a linked manifest that specifies an id, and the provided `id` parameter does not match the computed id, then installation will fail. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, to be clear, the API is now enforcing same-origin users to have a id
defined in the manifest file, regardless of whether they're using the 0-param or the 2-param version. I generally feel ok with that, given that a dev adding same-origin usage of navigator.install
on a site should also be able to update the manifest file.
That being said, if we're requiring a id
to be explicitly defined in the manifest now for same-origin, does it make sense to have an id
param at all? Should it just be a "one-param" method that takes the install_url
and optional install params? It's not clear to me what the value/scenario is. Would a dev at /foo/
that is trying to install the app on /bar/
care about the id
? Wouldn't they just care about installing "that app" that's at /bar/
and not "that app but only if its id hasn't changed since I last wrote this code?
Updates the same-origin Web Install explainer to support a 0-param installation (instead of requiring a single
id
param) and adds the requirement that the app to-be-installed must have a manifest with anid
field.