Skip to content

Commit d51655a

Browse files
committed
Add id member to manifest
1 parent 26842d0 commit d51655a

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

index.html

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ <h2>
201201
</li>
202202
<li>[=manifest/theme_color=]
203203
</li>
204+
<li>[=manifest/id=]
205+
</li>
204206
</ul>
205207
<aside class="note">
206208
<p>
@@ -242,6 +244,7 @@ <h3>
242244
"sizes": "128x128"
243245
}],
244246
"scope": "/",
247+
"id": "superracer",
245248
"start_url": "/start.html",
246249
"display": "fullscreen",
247250
"orientation": "landscape",
@@ -808,6 +811,53 @@ <h3>
808811
</p>
809812
</section>
810813
</section>
814+
<section>
815+
<h3>
816+
`id` member
817+
</h3>
818+
<p>
819+
The [=manifest's=] <code><dfn data-export="" data-dfn-for=
820+
"manifest">id</dfn></code> member is a <a>string</a> that
821+
represents the <dfn>id</dfn> for the application.
822+
</p>
823+
<p>The |id| is used by user agents uniquely identify the application
824+
globally. When |id| is changed, it's recognized as a new app and
825+
can be installed separately. When id is not changed, it can be used
826+
to find installed application to perform manifest update.
827+
</p>
828+
<p>
829+
The |id| can also be used by third party entities such as PWA stores
830+
to uniquely identify and reference web apps
831+
</p>
832+
<p>
833+
To <dfn>process the `id` member</dfn>, given [=object=]
834+
|json:JSON|, [=ordered map=] |manifest:ordered map|.:
835+
</p>
836+
<ol class="algorithm">
837+
<li>If the type of |json|["id"] is not [=string=], return.
838+
</li>
839+
<li>Let |id:URL| be the result of [=URL Parser|parsing=]
840+
(<var>start URL's origin</var> + "/" + |json|["id"]).
841+
</li>
842+
<li>If |id| is failure, return.
843+
</li>
844+
<li>Otherwise, set |manifest|["id"] to |start URL|.
845+
</li>
846+
</ol>
847+
<aside class="example">
848+
<p>
849+
For example, if the |start URL| is
850+
<samp>https://example.com/resources/start</samp>,
851+
and the value of [=manifest/id=] is <samp>"1"</samp>, then the
852+
processed result is <samp>https://example.com/1</samp>. If the
853+
value of [=manifest/id=] is <samp>""</samp>, then the processed
854+
result is <samp>https://example.com/</samp>. If [=manifest/id=]
855+
not specified, then the processed result is
856+
<samp>https://example.com/start</samp>.
857+
858+
</p>
859+
</aside>
860+
</section>
811861
<section>
812862
<h3>
813863
`theme_color` member
@@ -1084,6 +1134,9 @@ <h3>
10841134
<li>[=Process the `start_url` member=] passing |json|, |manifest|,
10851135
|manifest URL|, and |document URL|.
10861136
</li>
1137+
<li>[=Process the `id` member=] passing |json|, |manifest| and
1138+
|document URL|.
1139+
</li>
10871140
<li>[=Process the `scope` member=] passing |json|, |manifest|, and
10881141
|manifest URL|.
10891142
</li>

0 commit comments

Comments
 (0)