updated on 19th of December
Thanks everyone who participated in the discussion! It was tremendously userful
So, what we are going to do initially is only support:
<link rel="manifest" href="...some URL...">
By virtue of this being a URL, if people really want to inline the manifest they can use a data:
URL:
<link rel=manifest href="data:application/manifest+json,{ ... }">
Credit to @yoavweiss for proposing the above on the public-webapps mailing list.
If, after some time, we find a lot of people are inlining manifests in the wild, we can return and look at alternatives - like using <script>
or <meta>
.
We are trying to create a new manifest format for the Web. It will allow you to define metadata for a web application in one place.
Right now, we are trying to decide how to "inline" the manifest into HTML. Need your feedback.
<!doctype html>
<html>
<head>
...
<meta name="manifest" content='{
"name": "Example",
"url": "/start.html",
"mode": "standalone",
"icons": [{
"src": "icon/lowres",
"density": "1",
"width": "64",
"type": "image/webp"
}, {
"src": "icon/hd",
"density": "2",
"width": "64"
}]
}'>
...
<!doctype html>
<html>
<head>
...
<script type="application/manifest+json">
{
"name": "Example",
"url": "/start.html",
"mode": "standalone",
"icons": [{
"src": "icon/lowres",
"density": "1",
"width": "64",
"type": "image/webp"
}, {
"src": "icon/hd",
"density": "2",
"width": "64"
}]
}
</script>
<link rel="manifest" href="app.json">`
OR
<script src="app.json" type="application/manifest+json"></script>
Please share it in the comments!
I'd go for a solution, where the manifest info is in a separate file - but with a fixed name.
The separate file makes it very easy to e.g. make simple scripts to manage several apps, as they just have to know about this particular JSON file and not go through HTML parsing first (in principle) to figure out where to inject/extract info.
The reason why I would like to have a fixed name (e.g. app.json or the like - exactly like index.html has become a standard) is that browsers that can handle the manifest file would then first look for app.json, then index.html when presented with a fresh URL ending in a directory path (~ not a file).
Additionally (if not obvious) - if the JSON manifest file has a fixed name (allowing the browser to go for that file first), browses know a lot about the application prior to loading and parsing ANY other file (= speed, permissions/security, caching, icons, ...). This would also make it VERY efficient for e.g. a browser listing a bundle of applications (including reflecting updates, etc.)