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

Hi, I'm not an editor and they should be able to provide a definitive answer, but from my experience implementing the specification...

@dipikabh wrote:
> I am not clear about how to expand/replace/clarify "**document URL**":
> * Is it the URL of the page that links to the manifest file? or
> * Is it the URL of the page from which the app is installed (perhaps this was the case in the past? [Updating is under/incorrectly specified #384](https://github.com/w3c/manifest/issues/384)).

It is usually both. A user agent follows a manifest link relation in a page to fetch the manifest, and offers the user the option to install the web app from that page (which is then the "document URL"). It's not technically possible to install a web app from a web page outside the application (e.g. an app store) whilst conforming to the specification (although I believe Microsoft do do that, see #668).

> Are these statements correct:
> 
> * If `start_url` is not defined or invalid, then there is no default.
>       But would it be correct to assume that the page from which the app is installed is used, though it is not set as the default starting point. What page would open when users click on the app icon?

As I understand it if no `start_url` is specified in the manifest then the document URL (the document from which the manifest was linked to) is used as the default start URL. See the algorithm in [section 1.10](https://w3c.github.io/manifest/#start_url-member).

> * If the URL is relative, it is resolved against the manifest file's URL

Yes, I think that's correct.

> * The URL must be same-origin with the page that links to the manifest file.

Yes, otherwise the default (document URL) is used.

> * The URL must be within the defined `scope`.

Although effectively true, it actually works the other way around. If the start URL is not within scope of the scope member provided in the manifest, then the start URL (with filename, query and fragment removed) is used as the scope instead, rather than the value that was provided in the manifest.
 
> /cc @marcoscaceres @mgiuca : I'd appreciate your insights, thanks

I'd be interested to know whether my understanding differs!

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

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

Received on Monday, 14 October 2024 10:52:56 UTC