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

manifest.webmanifest or manifest.json #689

Closed
ghost opened this issue Jun 8, 2018 · 15 comments · Fixed by #802
Closed

manifest.webmanifest or manifest.json #689

ghost opened this issue Jun 8, 2018 · 15 comments · Fixed by #802

Comments

@ghost
Copy link

ghost commented Jun 8, 2018

I notice the w3c spec mentions manifest.webmanifest yet I see Google and Firefox and other browsers say to use manifest.json

Simple question: Should we use both or just pick one? ~As I can't find the answer in the spec. Plus the spec doesn't mention manifest.json either which seems strange.

(I been using the .json and seen no problems for several years, just wondered if I should add both).

Thanks.

@marcoscaceres
Copy link
Member

Using .json only is totally fine.

@marcoscaceres
Copy link
Member

Leaving this open so we can add a note to the spec.

@ghost
Copy link
Author

ghost commented Jun 9, 2018

Thank you.

@mgiuca
Copy link
Collaborator

mgiuca commented Jun 13, 2018

Note that the actual name (including the extension) are totally irrelevant, as long as you serve it with application/json (perhaps it doesn't even matter if you serve it with application/json). However, manifest.json is far more likely to be served with a correct MIME type, so I would be in favour of converting all documentation over to recommend that.

Edit: Whoa I just noticed the Media type registration section, which registers:

  • The MIME type application/manifest+json.
  • The file extension .webmanifest.

It RECOMMENDS (but does not REQUIRE) that the manifest be served with application/manifest+json. I was going to quickly update our docs, but it looks like there is a deeper issue if there is a normative RECOMMENDATION.

Questions:

  1. Do many popular web sites serve their manifest with application/manifest+json?
  2. Do any major web servers serve *.webmanifest files with MIME type application/manifest+json?
  3. Do any web browsers treat application/manifest+json any differently to application/json?

If the answer to all of the above is "no" (which I suspect it is), then perhaps we should consider removing this, and just using the .json file extension and application/json MIME type for manifests. We probably can't really delete any of this text, since legacy servers and sites may be serving application/manifest+json and/or expecting .webmanifest to map onto application/manifest+json. However, we could mark it deprecated, and change "the media type for a manifest" to application/json.

@nhoizey
Copy link

nhoizey commented Jul 5, 2018

I've been using manifest.webmanifest with a application/manifest+json MIME type for a while, because:

  • that's what I saw recommended (I don't remember where) when I created it
  • it allows me to use a different Expire header for manifests and other JSON files

@alrra
Copy link
Contributor

alrra commented Jul 5, 2018

it allows me to use a different header for manifests and other JSON files

Yes, the main reason was to make it easier to target the web app manifest file in the server configs. But there were other reasons.

@mgiuca
Copy link
Collaborator

mgiuca commented Jul 6, 2018

OK, I'm convinced that we should leave this. However, I think we should put application/json on equal footing with application/manifest+json (so user agents should be happy if the web server serves the manifest as either type). While a web server itself is allowed to serve using application/manifest+json and use that internally to configure other things like expire time.

Edit: I still think we could update the examples to use manifest.json since that is probably the easiest thing to configure (most web servers will likely serve manifest.json as application/json but manifest.webmanifest as text/plain or application/octet-stream).

@MatteoWebDeveloper
Copy link

what is the value having manifest.webmanifest? The actual format is a json. It's not another format.

@Malvoz
Copy link

Malvoz commented Jul 27, 2018

@MatteoWebDesigner

In the spec, under "Security and privacy considerations" it says:

[...] because there is no way to prevent developers from including custom/unrestrained data in a manifest, implementors need to impose their own implementation-specific limits [...]

So there may also be security related implications from serving a manifest with application/manifest+json rather than application/json.

@marcoscaceres
Copy link
Member

It also makes it easy to configure Apache and similar web servers, which is the main motivation.

christianliebel added a commit to christianliebel/angular-cli that referenced this issue Nov 9, 2018
Using the `webmanifest` file extension makes it easier to target the web app manifest in server configs and apply the correct MIME type (see w3c/manifest#689 (comment)).
hansl pushed a commit to angular/angular-cli that referenced this issue Dec 26, 2018
Using the `webmanifest` file extension makes it easier to target the web app manifest in server configs and apply the correct MIME type (see w3c/manifest#689 (comment)).
@ghost
Copy link
Author

ghost commented Dec 29, 2018

Going to close this as its old now and add a Summary:

The following methods are fine:

<link rel="manifest" href="/manifest.json">
<link rel="manifest" href="/manifest.webmanifest">

Both must have the MIME type: application/manifest+json

@thejohnjansen
Copy link

This is closed, but the spec still indicates that only .webmanifest is to be used. @marcoscaceres did you take an action item above to update the spec? Should that be a new issue?

@marcoscaceres
Copy link
Member

To be clear, any file extension can be used - or no file extension at all. It’s polite to send the right mime type, but what matters is that the body of the response is JSON. However, if a file extension must be used, .webmanifest remains the standard one.

We can add more guidance if you think it’s warranted.

@nhoizey
Copy link

nhoizey commented Aug 28, 2019

@marcoscaceres I agree more guidance would be nice to prevent such future discussions

@Hoodlum-Z
Copy link

I've personally being using .webmanifest since I thought that is what is the correct choice, as discussed in the link below.

https://developer.mozilla.org/en-US/docs/Web/Manifest

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

Successfully merging a pull request may close this issue.

8 participants