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

Add id member to manifest #988

Merged
merged 42 commits into from
Oct 5, 2021
Merged
Changes from 35 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
41b3b90
Add id member to manifest
philloooo Jul 15, 2021
d3885d2
Describe how a manifest can be updated with id
philloooo Jul 15, 2021
eb70381
address comments
philloooo Jul 20, 2021
fb3c3ff
Add example table
philloooo Jul 20, 2021
997c58a
re-order list
philloooo Jul 20, 2021
1d053f4
Merge branch 'gh-pages' into manifest-id
philloooo Jul 20, 2021
4afda14
quote all data
philloooo Jul 20, 2021
1817348
Update index.html
philloooo Aug 13, 2021
f743f90
update algorithm
philloooo Aug 13, 2021
93f83b7
Merge branch 'manifest-id' of github.com:philloooo/manifest into mani…
philloooo Aug 13, 2021
3659d38
Update index.html
philloooo Aug 13, 2021
c4016be
Merge branch 'manifest-id' of github.com:philloooo/manifest into mani…
philloooo Aug 13, 2021
5218606
update manifest update description
philloooo Aug 13, 2021
490a948
Clarify id equivalence
philloooo Aug 16, 2021
4e05505
refence url/equal concept in manifest update
philloooo Aug 16, 2021
e6c7461
remove vscode file
philloooo Aug 17, 2021
2cda2d4
Merge branch 'gh-pages' into manifest-id
philloooo Aug 19, 2021
4612577
Merge branch 'gh-pages' into manifest-id
philloooo Aug 27, 2021
73515ef
Update index.html
marcoscaceres Sep 21, 2021
b73baed
Update index.html
marcoscaceres Sep 21, 2021
579667e
Update index.html
marcoscaceres Sep 21, 2021
23c5ac7
Update index.html
marcoscaceres Sep 21, 2021
6c29909
Update index.html
marcoscaceres Sep 21, 2021
d29435f
Update index.html
marcoscaceres Sep 21, 2021
e1ab8a3
address some comments
philloooo Sep 21, 2021
d689b76
add more examples
philloooo Sep 21, 2021
66a1661
Update index.html
philloooo Sep 23, 2021
a006387
Update index.html
philloooo Sep 23, 2021
171575c
Update index.html
philloooo Sep 23, 2021
d4a7ac1
Update index.html
philloooo Sep 23, 2021
a222c0d
Update index.html
philloooo Sep 23, 2021
571f64c
update example for empty string
philloooo Sep 23, 2021
ee923ad
update processing algorithm
philloooo Sep 23, 2021
f9ca5a0
remove ascii code example
philloooo Sep 23, 2021
3a97b9e
Re-phrase identity equality section
philloooo Sep 24, 2021
bb5b117
remove fragment from default and processed id
philloooo Sep 27, 2021
3a70f20
Apply suggestions from code review
marcoscaceres Sep 29, 2021
f9d4edb
Update index.html
marcoscaceres Sep 29, 2021
f89eda6
remove manifest update
philloooo Sep 29, 2021
2fc8a9e
fix
philloooo Sep 29, 2021
f0817f0
Update index.html
marcoscaceres Oct 5, 2021
e753dc5
Apply suggestions from code review
marcoscaceres Oct 5, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
140 changes: 140 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ <h2>
</li>
<li>[=manifest/icons=]
</li>
<li>[=manifest/identity=]
</li>
<li>[=manifest/lang=]
</li>
<li>[=manifest/name=]
Expand Down Expand Up @@ -232,6 +234,7 @@ <h3>
"sizes": "128x128"
}],
"scope": "/",
"id": "superracer",
"start_url": "/start.html",
"display": "fullscreen",
"orientation": "landscape",
Expand Down Expand Up @@ -811,6 +814,116 @@ <h3>
</p>
</section>
</section>
<section>
<h3>
`id` member
</h3>
<p>
The [=manifest's=] <code><dfn data-export="" data-dfn-for=
"manifest" id="identity">id</dfn></code> member is a <a>string</a> that
marcoscaceres marked this conversation as resolved.
Show resolved Hide resolved
represents the <dfn>identity</dfn> for the application.
marcoscaceres marked this conversation as resolved.
Show resolved Hide resolved
The [=identity=] takes the form of a URL, which is same origin as the
start URL.
</p>
<p>The [=identity=] is used by user agents to uniquely identify the
application universally. When the user agent sees a manifest with an
[=identity=] that does not correspond to an already-installed
application, it SHOULD treat that manifest as a description of a
distinct application, even if it is served from the same URL as that of
another application. When the user agent sees a manifest where
|manifest|["id"] [=url/equal|equals=] the [=identity=] of an
already-installed application, it SHOULD be used as a signal that this
manifest is a replacement for the already-installed application's
manifest, and not a distinct application, even if it is served from a
different URL than the one seen previously.
</p>
<p class="note">
The [=identity=] can be used by a service that collects lists of web
applications to uniquely identify applications.
</p>
<p class="note">
The [=identity=] is processed like a URL but it doesn't point to a
resource that can be navigated to, so it's not required to be
[=URL/within scope=].
</p>
<p>
To <dfn>process the `id` member</dfn>, given [=object=]
|json:JSON|, [=ordered map=] |manifest:ordered map|:
</p>
<ol class="algorithm">
<li>Set |manifest|["id"] to |manifest|["start_url"].
marcoscaceres marked this conversation as resolved.
Show resolved Hide resolved
</li>
<li>If the type of |json|["id"] is not [=string=], return.
</li>
<li>If |json|["id"] is the empty string, return.
</li>
<li>Let |base origin| be |manifest|["start_url"]'s [=url/origin=].</li>
<li>Let |id:URL| be the result of [=URL Parser|parsing=] |json|["id"] with |base origin| as the base URL.
</li>
<li>If |id| is failure, return.
</li>
<li>If |id| is not [=same origin=] as |manifest|["start_url"], return.
</li>
<li>Otherwise, set |manifest|["id"] to |id|.</li>
philloooo marked this conversation as resolved.
Show resolved Hide resolved
</ol>
<aside class="example">
<p>Below table shows some example cases of the |identity| processing algorithm.</p>
<table class="data">
<tr>
<th>|json|["id"]</th>
<th>|manifest|["start_url"]</th>
<th>|manifest|["id"]</th>
marcoscaceres marked this conversation as resolved.
Show resolved Hide resolved
<th>Explaination</th>
philloooo marked this conversation as resolved.
Show resolved Hide resolved
</tr>
<tr>
<td><i>undefined</i></td>
<td>"https://example.com/my-app/start"</td>
<td>"https://example.com/my-app/start"</td>
</tr>
<tr>
<td>""</td>
philloooo marked this conversation as resolved.
Show resolved Hide resolved
<td>"https://example.com/my-app/start"</td>
<td>"https://example.com/my-app/start"</td>
</tr>
<tr>
<td>"/"</td>
<td>"https://example.com/my-app/start"</td>
<td>"https://example.com/"</td>
</tr>
<tr>
<td>"foo"</td>
<td>"https://example.com/my-app/start"</td>
<td>"https://example.com/foo"</td>
</tr>
<tr>
<td>"./foo"</td>
<td>"https://example.com/my-app/start"</td>
<td>"https://example.com/foo"</td>
marcoscaceres marked this conversation as resolved.
Show resolved Hide resolved
</tr>
<tr>
<td>"https://example.com/foo"</td>
<td>"https://example.com/my-app/start"</td>
<td>"https://example.com/foo"</td>
</tr>
<tr>
<td>"https://anothersite.com/foo"</td>
<td>"https://example.com/my-app/start"</td>
<td>"https://example.com/my-app/start"</td>
</tr>
<tr>
<td>"😀"</td>
<td>"https://example.com/my-app/start"</td>
<td>"https://example.com/%F0%9F%98%80"</td>
</tr>
</table>
<p>Since [=manifest/id=] is resolved against [=manifest/start_url=]'s [=URL/origin=], providing
"../foo", "foo", "/foo", "./foo" all resolves to the same [=identifier=]. It is
As such, best practice is to use a leading "/" to be explicit that
the id is a root-relative url path. Also, standard
encoding/decoding rules are apply to the id processing algorithm, as per the [[[URL]]].
</p>
</aside>
</section>
<section>
<h3>
`theme_color` member
Expand Down Expand Up @@ -1093,6 +1206,9 @@ <h3>
<li>[=Process the `start_url` member=] passing |json|, |manifest|,
|manifest URL|, and |document URL|.
</li>
<li>[=Process the `id` member=] passing |json|, |manifest| and
|document URL|.
</li>
<li>[=Process the `scope` member=] passing |json|, |manifest|, and
|manifest URL|.
</li>
Expand Down Expand Up @@ -1222,6 +1338,30 @@ <h3>
Updating the manifest
</h3>
<aside class="issue" data-number="446"></aside>
marcoscaceres marked this conversation as resolved.
Show resolved Hide resolved
<p>
marcoscaceres marked this conversation as resolved.
Show resolved Hide resolved
marcoscaceres marked this conversation as resolved.
Show resolved Hide resolved
The manifest is fetched and processed on every page load. When the
processing is successful, user agents MAY apply updated manifest to
any current and future <a>application contexts</a>
associated with the application.
</p>
<p>
When the user agent fetches a manifest as part of an update check,
it MUST [=url/equal|compare=] the fetched processed manifest's
[=manifest/identity=] with the identity of the app being updated. If
it is not equal, the user agent MUST NOT update the installed
application's manifest.
</p>
<section>
<h3>
Privacy and security consideration
</h3>
<p>
User agents SHOULD be careful about performing update to manifest
philloooo marked this conversation as resolved.
Show resolved Hide resolved
fields like app name and icons. Users should be fully aware if
such fields are to be be updated to avoid web applications being
installed and silently changed to appear as a different one.
</p>
</section>
</section>
</section>
</section>
Expand Down