Skip to content

Commit

Permalink
Merge pull request #1018 from w3c/add-client-type
Browse files Browse the repository at this point in the history
Add client.type
  • Loading branch information
jungkees committed Dec 2, 2016
2 parents ddf95c3 + 574db3b commit 2d3f068
Show file tree
Hide file tree
Showing 4 changed files with 250 additions and 166 deletions.
11 changes: 11 additions & 0 deletions docs/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
interface Client {
readonly attribute USVString url;
readonly attribute DOMString id;
readonly attribute ClientType type;
readonly attribute boolean reserved;
void postMessage(any message, optional sequence<object> transfer = []);
};
Expand Down Expand Up @@ -902,6 +903,16 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
The <dfn attribute for="Client"><code>id</code></dfn> attribute *must* return its associated [=Client/service worker client=]'s [=environment/id=].
</section>

<section>
<h4 id="client-type">{{Client/type}}</h4>

The <dfn attribute for="Client"><code>type</code></dfn> attribute *must* run these steps:

1. If the [=context object=]'s [=Client/service worker client=] is a type of [=environment=] or is a [=window client=], return {{ClientType/"window"}}.
1. Else if the [=context object=]'s [=Client/service worker client=] is a [=dedicated worker client=], return {{ClientType/"worker"}}.
1. Else if the [=context object=]'s [=Client/service worker client=] is a [=shared worker client=], return {{ClientType/"sharedworker"}}.
</section>

<section>
<h4 id="client-reserved">{{Client/reserved}}</h4>

Expand Down
Loading

0 comments on commit 2d3f068

Please sign in to comment.