Re: [w3c/manifest] Clarification needed for document URL (Issue #1147)

@dipikabh Thank you for your questions. @benfrancis's answers are correct.

> I'd be interested to add this information to our reference page once the editors confirm this behavior.

Yes, I can confirm this behavior: Web app installation occurs while a particular document (page) is loaded. Upon installation, the manifest file linked in this document is fetched. So the document linking to the manifest and installing the app is one and the same, and so is its URL.

> The [`start_url` updates](https://developer.mozilla.org/en-US/docs/Web/Manifest/start_url#values) have landed but I can see the need to clarify what happens when `start_url` is not within `scope`. I've mentioned it on the [`scope` page](https://developer.mozilla.org/en-US/docs/Web/Manifest/scope#values) but it needs a mention on the `start_url` page as well. I should also update the "same-origin with the page that links to the manifest file" requirement.

The description of the [`scope` value](https://developer.mozilla.org/en-US/docs/Web/Manifest/scope#scope) is correct, except the following sentence, which is a bit tricky:

> The [start_url](https://developer.mozilla.org/en-US/docs/Web/Manifest/start_url) must be within the defined scope.

This depends on which scope you are referring to, the author-defined `scope` value in the manifest, or the effective/processed scope after processing the manifest.

As @benfrancis laid out, the `start_url` doesn't necessarily _have_ to be within the scope defined by the `scope` member in the manifest. If the `start_url` is outside this scope, its value will be ignored, and the "processed scope" will be adjusted to contain the `start_url`, which you correctly describe later in that section.

Authors _should_ define the `scope` member in the manifest so that the `start_url` is within scope, because the value will be ignored otherwise. Maybe you could simply leave this sentence out, as you already correctly describe this behavior later in the section. 

Regarding the [`start_url` value](https://developer.mozilla.org/en-US/docs/Web/Manifest/start_url#start_url):

> The start_url must be within the scope of the web app and must be same-origin with the manifest URL.

1. The same applies here regarding `start_url`. Maybe you could rephrase this: _If the `scope` value is not defined in the manifest or `start_url` is not within this scope, the scope will be set to the `start_url` with the filename, query, and fragment removed._
2. The specification does not require the `start_url` to be same-origin with the manifest URL but with the document URL (see [process the `start_url` member](https://w3c.github.io/manifest/#dfn-process-the-start_url-member), step 6). This allows serving the manifest from a different origin but restricts installing apps to the origin of the document triggering installation.

I hope this clarifies all of your open questions.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/manifest/issues/1147#issuecomment-2466072414
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/manifest/issues/1147/2466072414@github.com>

Received on Saturday, 9 November 2024 06:14:18 UTC