98
98
To register a site as a share target, a < a > share_target</ a > entry is
99
99
added to the < a data-cite ="appmanifest "> Web App Manifest</ a > , as shown:
100
100
</ p >
101
- < pre class ="example json " title ="manifest.webmanifest ">
101
+ < pre class ="example json " title ="manifest.webmanifest ">
102
102
{
103
103
"name": "Includinator",
104
104
"share_target": {
@@ -112,10 +112,10 @@ <h2>
112
112
}
113
113
</ pre >
114
114
< p >
115
- The < a data-link-for ="ShareTarget "> params</ a > keys correspond to the key
116
- names in < a data-cite ="!WebShare#dom-sharedata "> ShareData</ a > from
117
- [[!WebShare]], while the values are arbitrary names that will be used as
118
- query parameters when the target is launched.
115
+ The < a data-link-for ="ShareTarget "> params</ a > keys correspond to the
116
+ key names in < a data-cite ="!WebShare#dom-sharedata "> ShareData</ a > from
117
+ [[!WebShare]], while the values are arbitrary names that will be used
118
+ as query parameters when the target is launched.
119
119
</ p >
120
120
< p >
121
121
When a share takes place, if the user selects this share target, the
149
149
< code > http://example.com/news</ code > , the user agent will open a new
150
150
window or tab and navigate to:
151
151
</ p >
152
- < pre >
152
+ < pre >
153
153
https://example.org/includinator/share.html?name=My%20News&description=&link=http%3A%2F%2Fexample.com%2Fnews
154
154
</ pre >
155
155
< p >
@@ -246,33 +246,34 @@ <h3>
246
246
< li > If < var > share target</ var > is < code > undefined</ code > , then return
247
247
< code > undefined</ code > .
248
248
</ li >
249
- < li > If < var > share
250
- target </ var > [" < a data-link-for =" ShareTarget "> method</ a > "] is not an
251
- < a data-cite = "!INFRA#ascii-case-insensitive "> ASCII case-insensitive
252
- </ a > match for the string < code > "GET"</ code > ,
253
- < a data-cite = "!appmanifest#dfn-issue-a-developer-warning "> issue a
254
- developer warning</ a > that the method is not supported, and return
249
+ < li > If < var > share target </ var > [" < a data-link-for =
250
+ " ShareTarget "> method</ a > "] is not an < a data-cite =
251
+ "!INFRA#ascii-case-insensitive "> ASCII case-insensitive</ a > match for
252
+ the string < code > "GET"</ code > , < a data-cite =
253
+ "!appmanifest#dfn-issue-a-developer-warning "> issue a developer
254
+ warning</ a > that the method is not supported, and return
255
255
< code > undefined</ code > .
256
256
</ li >
257
- < li > Let < var > action</ var > be the result of
258
- < a data-cite = "!URL#concept-url-parser "> parsing</ a > the
259
- < a data-cite = "!URL#concept-url "> URL</ a > < var > share
260
- target</ var > ["< a data-link-for ="ShareTarget "> action</ a > "], relative to
261
- the < var > manifest URL</ var > and with no encoding override. If the
262
- result is failure,
263
- < a data-cite = "!appmanifest#dfn-issue-a-developer-warning "> issue
264
- a developer warning</ a > and return < code > undefined</ code > .
257
+ < li > Let < var > action</ var > be the result of < a data-cite =
258
+ "!URL#concept-url-parser "> parsing</ a > the < a data-cite =
259
+ "!URL#concept-url "> URL</ a > < var > share
260
+ target</ var > ["< a data-link-for ="ShareTarget "> action</ a > "], relative
261
+ to the < var > manifest URL</ var > and with no encoding override. If
262
+ the result is failure, < a data-cite =
263
+ "!appmanifest#dfn-issue-a-developer-warning "> issue a developer
264
+ warning</ a > and return < code > undefined</ code > .
265
265
</ li >
266
266
< li > If < var > action</ var > is not < a data-cite =
267
267
"!appmanifest#dfn-within-scope "> within scope</ a > of < var > scope
268
268
URL</ var > , < a data-cite ="!appmanifest#dfn-issue-a-developer-warning ">
269
- issue a developer warning</ a > that < a data-link-for ="ShareTarget ">
270
- action</ a > is outside of the
271
- < a data-cite ="!appmanifest#dfn-navigation-scope "> navigation scope
272
- </ a > , and return < code > undefined</ code > .
269
+ issue a developer warning</ a > that < a data-link-for =
270
+ "ShareTarget "> action</ a > is outside of the < a data-cite =
271
+ "!appmanifest#dfn-navigation-scope "> navigation scope</ a > , and
272
+ return < code > undefined</ code > .
273
+ </ li >
274
+ < li > Set < var > share target</ var > ["< a data-link-for =
275
+ "ShareTarget "> action</ a > "] to < var > action</ var > .
273
276
</ li >
274
- < li > Set < var > share target</ var > ["< a
275
- data-link-for ="ShareTarget "> action</ a > "] to < var > action</ var > .
276
277
< li > Return < var > share target</ var > .
277
278
</ li >
278
279
</ ol >
@@ -286,13 +287,13 @@ <h3>
286
287
</ p >
287
288
< p >
288
289
The < dfn > action</ dfn > member specifies the < a data-cite =
289
- "!URL#concept-url "> URL</ a > for the
290
- < a data-link-for = "web share targets "> web share target</ a > .
290
+ "!URL#concept-url "> URL</ a > for the < a data-link-for =
291
+ "web share targets "> web share target</ a > .
291
292
</ p >
292
293
< p >
293
- The < dfn > method</ dfn > member specifies the HTTP request
294
- < a href = "https://tools.ietf.org/html/rfc7231#section-4 "> method</ a > for
295
- the < a data-link-for ="web share targets "> web share target</ a > .
294
+ The < dfn > method</ dfn > member specifies the HTTP request < a href =
295
+ "https://tools.ietf.org/html/rfc7231#section-4 "> method</ a > for the
296
+ < a data-link-for ="web share targets "> web share target</ a > .
296
297
</ p >
297
298
< p >
298
299
The < dfn > params</ dfn > member contains a < a > ShareTargetParams</ a >
320
321
</ p >
321
322
< p >
322
323
The query parameters will be populated with information from the
323
- < a data-cite ="!WebShare#dom-sharedata "> ShareData</ a >
324
- being shared. If the ShareData contains no information for a given
325
- member, the query parameter will receive an empty string.
324
+ < a data-cite ="!WebShare#dom-sharedata "> ShareData</ a > being shared. If
325
+ the ShareData contains no information for a given member, the query
326
+ parameter will receive an empty string.
326
327
</ p >
327
328
</ section >
328
329
</ section >
361
362
(perhaps using the same UI as < a data-cite =
362
363
"HTML#dom-navigator-registerprotocolhandler "> < code > navigator.registerProtocolHandler</ code > </ a > ).
363
364
</ li >
364
- < li > Only register a web share target if it has a service worker.</ li >
365
+ < li > Only register a web share target if it has a service worker.
366
+ </ li >
365
367
</ ul >
366
368
</ div >
367
369
< p >
@@ -449,61 +451,51 @@ <h3>
449
451
run the following steps:
450
452
</ p >
451
453
< ol >
452
- < li >
453
- Let < var > action </ var > be < var > manifest </ var > ["< a
454
- > share_target </ a > "][" < a data-link-for = "ShareTarget "> action</ a > "].
454
+ < li > Let < var > action </ var > be
455
+ < var > manifest </ var > [" < a > share_target </ a > "] ["< a data-link-for =
456
+ "ShareTarget "> action</ a > "].
455
457
</ li >
456
- < li >
457
- Let < var > entry list </ var > be a new empty list of name-value tuples.
458
+ < li > Let < var > entry list </ var > be a new empty list of name-value
459
+ tuples.
458
460
</ li >
459
- < li >
460
- For each < var > member</ var > in the sequence « < code > "title"</ code > ,
461
- < code > "text"</ code > , < code > "url"</ code > »,
461
+ < li > For each < var > member</ var > in the sequence «
462
+ < code > "title"</ code > , < code > "text"</ code > , < code > "url"</ code > »,
462
463
< ul >
463
- < li >
464
- Let < var > name</ var > be the value of
465
- < var > manifest</ var > ["< a > share_target</ a > "]["< a
466
- data-link-for ="ShareTarget "> params</ a > "][< var > member</ var > ].
464
+ < li > Let < var > name</ var > be the value of
465
+ < var > manifest</ var > ["< a > share_target</ a > "]["< a data-link-for =
466
+ "ShareTarget "> params</ a > "][< var > member</ var > ].
467
467
</ li >
468
- < li >
469
- If < var > name</ var > is < code > undefined</ code > or an empty string,
470
- then continue.
468
+ < li > If < var > name</ var > is < code > undefined</ code > or an empty
469
+ string, then continue.
471
470
</ li >
472
- < li >
473
- Let < var > value</ var > be the value of
474
- < var > data</ var > [< var > member</ var > ].
471
+ < li > Let < var > value</ var > be the value of
472
+ < var > data</ var > [< var > member</ var > ].
475
473
</ li >
476
- < li >
477
- If < var > value</ var > is < code > undefined</ code > , set
478
- < var > value</ var > to an empty string.
474
+ < li > If < var > value</ var > is < code > undefined</ code > , set
475
+ < var > value</ var > to an empty string.
479
476
</ li >
480
477
< li >
481
478
< a data-cite ="!INFRA#list-append "> Append</ a > to < var > entry
482
479
list</ var > a tuple with < var > name</ var > and < var > value</ var > .
483
480
</ li >
484
481
</ ul >
485
482
</ li >
486
- < li >
487
- Let < var > query</ var > be the result of running the
488
- < a data-cite ="!URL#concept-urlencoded-serializer ">
489
- < code > application/x-www-form-urlencoded</ code > serializer</ a > with
490
- entry list and no encoding override.
483
+ < li > Let < var > query</ var > be the result of running the < a data-cite =
484
+ "!URL#concept-urlencoded-serializer "> < code > application/x-www-form-urlencoded</ code >
485
+ serializer</ a > with entry list and no encoding override.
491
486
</ li >
492
- < li >
493
- Set < var > action</ var > 's
494
- < a data-cite ="!URL#concept-url-query "> query</ a >
495
- component to < var > query</ var > .
487
+ < li > Set < var > action</ var > 's < a data-cite =
488
+ "!URL#concept-url-query "> query</ a > component to < var > query</ var > .
496
489
</ li >
497
- < li >
498
- Run the < a data-cite ="!HTML#window-open-steps "> window open steps</ a >
499
- on < var > action</ var > , with empty < var > target</ var > and empty
500
- < var > features</ var > .
490
+ < li > Run the < a data-cite ="!HTML#window-open-steps "> window open
491
+ steps</ a > on < var > action</ var > , with empty < var > target</ var > and
492
+ empty < var > features</ var > .
501
493
</ li >
502
494
</ ol >
503
495
< p class ="note ">
504
- This algorithm assumes that < var > manifest</ var > has
505
- had the < a > post-processing the < code > share_target</ code > member</ a >
506
- algorithm run on it and still has a < a > share_target</ a > afterwards.
496
+ This algorithm assumes that < var > manifest</ var > has had the
497
+ < a > post-processing the < code > share_target</ code > member</ a > algorithm
498
+ run on it and still has a < a > share_target</ a > afterwards.
507
499
</ p >
508
500
</ section >
509
501
</ section >
0 commit comments