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

What's the default value of the id member if no start_url is provided? #1038

Closed
benfrancis opened this issue May 12, 2022 · 2 comments
Closed

Comments

@benfrancis
Copy link
Member

If no id or start_url member is provided, what is the value of the processed id?

As I understand it, id is essentially meant to default to start_url, but what does start_url default to?

The start_url algorithm says:

If json["start_url"] doesn't exist... return"

The id algorithm says:

If the type of json["id"] is not string, return.

but then what?

I'm probably just not understanding the way the algorithms are written, does return mean something other than "stop executing the algorithm"?

@alancutter
Copy link
Contributor

These algorithms take a manifest out parameter that's passed in in the overall processing a manifest algorithm.
https://w3c.github.io/manifest/#dfn-processing-a-manifest
I'm a bit surprised there doesn't seem to be anywhere that defaults it to the document URL or declares it invalid and unable to be installed or something.

@benfrancis
Copy link
Member Author

@alancutter I'm not sure I understand what you mean by "manifest out parameter", but I see that step 5 of that algorithm appears to initialise manifest with a default ordered map in which the value of the start_url member is set to the document URL.

So I guess that answers my question. If no start_url is provided, the default id is the document URL (i.e. the web page from which the manifest was linked). That means that the id will be different depending on which page of a mutli-page web application the app was installed from.

(It's a shame this further couples manifest processing with a document URL instead of the manifest URL, which prevents installation from external sources like app stores, mobile device management services and digital signage platforms, but I guess that ship has already sailed).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants