Skip to content
This repository has been archived by the owner on May 13, 2021. It is now read-only.

Review how manifoldjs processes the scope member of manifest.json #60

Closed
ghost opened this issue May 12, 2015 · 6 comments
Closed

Review how manifoldjs processes the scope member of manifest.json #60

ghost opened this issue May 12, 2015 · 6 comments
Milestone

Comments

@ghost
Copy link

ghost commented May 12, 2015

This issue is to review the behavior of manifoldjs with the scope member, which was raised in issue #42

@ghost ghost mentioned this issue May 12, 2015
@ghost ghost added this to the release-0.1.4 milestone May 12, 2015
@ghost ghost assigned ghost and unassigned ghost May 15, 2015
@boyofgreen
Copy link
Contributor

is this work already in 0.1.4? can we close?

@ghost
Copy link
Author

ghost commented May 18, 2015

This issue is still open, but it is the next one in the list.

@marcoscaceres
Copy link
Contributor

Please let me know if anything is not clear in the spec. That part of the spec is quite new, so if something doesn't make sense or needs clarification, I'm all ears and happy to fix stuff.

@ghost
Copy link
Author

ghost commented May 19, 2015

Thanks @marcoscaceres . After taking a look at the specs for the scope member, I have a few questions:

  • Are absolute URLs considered valid for the scope value (e.g. "http://domain.com/racer" assuming that this matches the origin of the start URL) or only relative URLs (e.g. "/", or "/racer/")?
  • Are wildcards ("") allowed as part of the scope value (e.g. "/", or "/racer/")?
  • It is not clear what the document URL means in the steps to process the scope member. Can you clarify?

@marcoscaceres
Copy link
Contributor

  • Are absolute URLs considered valid for the scope value (e.g. "http://domain.com/racer" assuming that this matches the origin of the start URL) or only relative URLs (e.g. "/", or "/racer/")?

Yes, absolutely. All URLs are resolved against the manifest's URL. I.e., the browser just does:

// manifestURL is the URL where the manifest is located, e.g., https://foo.com/manifest.json
var scope = new URL("*/*", manifestURL); 
  • Are wildcards ("") allowed as part of the scope value (e.g. "/", or "/racer/")?

Yes. But they don't mean anything (i.e., it's not used for any kind of wild-card matching by the implementation). For example, this is what the browser does:

//resolve against manifest URL
var scope = new URL("*/*", manifestURL); 
// would just give:  
"https://example.com/*/*"

If you have a server that serves resources from "/", then it will work as normal on the Web.

  • It is not clear what the document URL means in the steps to process the scope member. Can you clarify?

The document from which the manifest is acquired. So, for instance, if the application is at "http://example.com/index.html", then that is the "document URL". That URL will be different from the manifest URL, which would be at, for example, "http://example.com/manifest.json".

@marcoscaceres
Copy link
Contributor

If it helps, here is my implementation of it in Gecko:
https://github.com/mozilla/gecko-dev/blob/master/dom/manifest/ManifestProcessor.jsm#L188

@ghost ghost self-assigned this May 20, 2015
ghost referenced this issue in pwa-builder/ManifoldCordova May 20, 2015
ghost referenced this issue in pwa-builder/ManifoldCordova May 20, 2015
… in the scope member. Now, a relative path defined in the scope like "/somepath/" is now mapped to an access rule of the form "{baseUrl}/somepath/*", while absolute URLs like "http://mydomain.com" are mapped to "http://mydomain.com/*".
ghost referenced this issue in pwa-builder/ManifoldCordova May 21, 2015
ghost referenced this issue in pwa-builder/ManifoldCordova May 22, 2015
ghost referenced this issue May 22, 2015
…hosted web apps platform. Now, a relative path defined in the scope like "/somepath/" is now mapped to a rule of the form "{baseUrl}/somepath/*" (where {baseUrl} is the base URL taken from start_url), while absolute URLs like "http://mydomain.com" are mapped to "http://mydomain.com/*".
@ghost ghost closed this as completed May 22, 2015
@ghost ghost mentioned this issue May 26, 2015
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants