id
attribute *must* return its associated [=Client/service worker client=]'s [=environment/id=].
+ type
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"}}.
+ url
id
- reserved
- postMessage(message, transfer)
- visibilityState
- focused
- ancestorOrigins
- focus()
- navigate(url)
+ type
+ reserved
+ postMessage(message, transfer)
+ visibilityState
+ focused
+ ancestorOrigins
+ focus()
+ navigate(url)
Clients
@@ -2406,6 +2407,7 @@ id
attribute must return its associated service worker client's id.
reserved
type
The type
attribute must run these steps:
If the context object's service worker client is a type of environment or is a window client, return "window"
.
Else if the context object's service worker client is a dedicated worker client, return "worker"
.
Else if the context object's service worker client is a shared worker client, return "sharedworker"
.
reserved
The reserved
attribute must return the context object’s associated reserved state.
postMessage(message, transfer)
postMessage(message, transfer)
The postMessage(message, transfer)
method must run these steps:
Let sourceSettings be the context object’s relevant settings object.
Let destination be the ServiceWorkerContainer
object whose service worker client is the context object’s service worker client.
Let destination be the ServiceWorkerContainer
object whose service worker client is the context object’s service worker client.
If destination is null, throw an "InvalidStateError
" exception.
visibilityState
visibilityState
The visibilityState
attribute must return the context object’s visibility state.
focused
focused
The focused
attribute must return the context object’s focus state.
ancestorOrigins
The ancestorOrigins
attribute must return the context object’s associated service worker client's ancestor origins array.
ancestorOrigins
The ancestorOrigins
attribute must return the context object’s associated service worker client's ancestor origins array.
focus()
focus()
The focus()
method must run these steps:
Let browsingContext be the context object’s associated service worker client's global object's browsing context.
+Let browsingContext be the context object’s associated service worker client's global object's browsing context.
Let visibilityState be null.
Let ancestorOrigins be the empty array.
Queue a task task to run the following substeps on the context object’s associated service worker client's responsible event loop using the user interaction task source:
+Queue a task task to run the following substeps on the context object’s associated service worker client's responsible event loop using the user interaction task source:
Run the focusing steps with browsingContext.
@@ -2518,7 +2532,7 @@Wait for task to have executed.
Let windowClient be the result of running Create Window Client algorithm with the context object’s associated service worker client, visibilityState, focusState, and ancestorOrigins as the arguments.
+Let windowClient be the result of running Create Window Client algorithm with the context object’s associated service worker client, visibilityState, focusState, and ancestorOrigins as the arguments.
If windowClient’s focus state is true, resolve promise with windowClient.
navigate(url)
navigate(url)
The navigate()
method must run these steps:
If url is about:blank
, return a promise rejected with a TypeError
.
If the context object’s associated service worker client's active service worker is not the context object’s relevant global object’s service worker, return a promise rejected with a TypeError
.
If the context object’s associated service worker client's active service worker is not the context object’s relevant global object’s service worker, return a promise rejected with a TypeError
.
Let promise be a new promise.
Run these substeps in parallel:
Let browsingContext be the context object’s associated service worker client's global object's browsing context.
+Let browsingContext be the context object’s associated service worker client's global object's browsing context.
If browsingContext has discarded its Document
, reject promise with a TypeError
and abort these steps.
Let ancestorOrigins be the empty array.
Queue a task task to run the following substeps on the context object’s associated service worker client's responsible event loop using the user interaction task source:
+Queue a task task to run the following substeps on the context object’s associated service worker client's responsible event loop using the user interaction task source:
HandleNavigate: Navigate browsingContext to url with exceptions enabled. The source browsing context must be browsingContext.
@@ -2607,7 +2621,7 @@enum ClientType { @@ -2645,7 +2659,7 @@secure context, reject promise with a "
SecurityError
" exception and abort these steps.
If client is a type of environment or is a window client, then:
+If client is a type of environment or is a window client, then:
Let browsingContext be null.
@@ -2667,7 +2681,7 @@Set focusState to the result of running the has focus steps with browsingContext’s active document as the argument.
If client is a window client, set ancestorOrigins to browsingContext’s active document’s relevant global object’s Location
object’s ancestor origins array.
If client is a window client, set ancestorOrigins to browsingContext’s active document’s relevant global object’s Location
object’s ancestor origins array.
Wait for task to have executed.
@@ -2739,7 +2753,7 @@If options.type
is "window"
or "all"
, and client is a type of environment or is a window client, then:
If options.type
is "window"
or "all"
, and client is a type of environment or is a window client, then:
Let browsingContext be null.
@@ -2767,7 +2781,7 @@Set focusState to the result of running the has focus steps with browsingContext’s active document as the argument.
It client is a window client, set ancestorOrigins to browsingContext’s active document’s relevant global object’s Location
object’s ancestor origins array.
It client is a window client, set ancestorOrigins to browsingContext’s active document’s relevant global object’s Location
object’s ancestor origins array.
Wait for task to have executed.
@@ -2782,7 +2796,7 @@Else if options.type
is "worker"
or "all"
and client is a dedicated worker client, or options.type
is "sharedworker"
or "all"
and client is a shared worker client, then:
Else if options.type
is "worker"
or "all"
and client is a dedicated worker client, or options.type
is "sharedworker"
or "all"
and client is a shared worker client, then:
Let clientObject be the result of running Create Client algorithm with client as the argument.
@@ -2794,11 +2808,11 @@WindowClient
objects are always placed before Client
objects whose associated service worker clients are worker clients.
WindowClient
objects are always placed before Client
objects whose associated service worker clients are worker clients.
WindowClient
objects that have been focused are placed first sorted in the most recently focused order, and WindowClient
objects that have never been focused are placed next sorted in their service worker clients' creation order.
WindowClient
objects that have been focused are placed first sorted in the most recently focused order, and WindowClient
objects that have never been focused are placed next sorted in their service worker clients' creation order.
Client
objects whose associated service worker clients are worker clients are placed next sorted in their service worker clients' creation order.
Client
objects whose associated service worker clients are worker clients are placed next sorted in their service worker clients' creation order.
Resolve promise with matchedClients.
@@ -5025,9 +5039,9 @@If client is a window client, unassociate client’s responsible document from its application cache, if it has one.
+If client is a window client, unassociate client’s responsible document from its application cache, if it has one.
Else if client is a shared worker client, unassociate client’s global object from its application cache, if it has one.
+Else if client is a shared worker client, unassociate client’s global object from its application cache, if it has one.
Note: Resources will now use the service worker registration instead of the existing application cache.
If request is a navigation request, initialize e’s targetClientId
attribute to request’s target client id, and to the empty string otherwise.
Let the isReload
attribute of e be initialized to true
if request’s client is a window client and the event was dispatched with the user’s intention for the page reload, and false
otherwise.
Let the isReload
attribute of e be initialized to true
if request’s client is a window client and the event was dispatched with the user’s intention for the page reload, and false
otherwise.
Dispatch e at activeWorker’s global object.
Let clientObject be a new Client
object.
Set clientObject’s service worker client to client.
+Set clientObject’s service worker client to client.
Set clientObject’s reserved state to true if client’s execution ready flag is unset, and false otherwise.
Let windowClient be a new WindowClient
object.
Set windowClient’s service worker client to client.
+Set windowClient’s service worker client to client.
Set windowClient’s visibility state to visibilityState.
type
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"}}.
+ url
id
- reserved
- postMessage(message, transfer)
- visibilityState
- focused
- ancestorOrigins
- focus()
- navigate(url)
+ type
+ reserved
+ postMessage(message, transfer)
+ visibilityState
+ focused
+ ancestorOrigins
+ focus()
+ navigate(url)
Clients
@@ -2395,6 +2396,7 @@ id
attribute must return its associated service worker client's id.
reserved
type
The type
attribute must run these steps:
If the context object's service worker client is a type of environment or is a window client, return "window"
.
Else if the context object's service worker client is a dedicated worker client, return "worker"
.
Else if the context object's service worker client is a shared worker client, return "sharedworker"
.
reserved
The reserved
attribute must return the context object’s associated reserved state.
postMessage(message, transfer)
postMessage(message, transfer)
The postMessage(message, transfer)
method must run these steps:
Let sourceSettings be the context object’s relevant settings object.
Let destination be the ServiceWorkerContainer
object whose service worker client is the context object’s service worker client.
Let destination be the ServiceWorkerContainer
object whose service worker client is the context object’s service worker client.
If destination is null, throw an "InvalidStateError
" exception.
visibilityState
visibilityState
The visibilityState
attribute must return the context object’s visibility state.
focused
focused
The focused
attribute must return the context object’s focus state.
ancestorOrigins
The ancestorOrigins
attribute must return the context object’s associated service worker client's ancestor origins array.
ancestorOrigins
The ancestorOrigins
attribute must return the context object’s associated service worker client's ancestor origins array.
focus()
focus()
The focus()
method must run these steps:
Let browsingContext be the context object’s associated service worker client's global object's browsing context.
+Let browsingContext be the context object’s associated service worker client's global object's browsing context.
Let visibilityState be null.
Let ancestorOrigins be the empty array.
Queue a task task to run the following substeps on the context object’s associated service worker client's responsible event loop using the user interaction task source:
+Queue a task task to run the following substeps on the context object’s associated service worker client's responsible event loop using the user interaction task source:
Run the focusing steps with browsingContext.
@@ -2507,7 +2521,7 @@Wait for task to have executed.
Let windowClient be the result of running Create Window Client algorithm with the context object’s associated service worker client, visibilityState, focusState, and ancestorOrigins as the arguments.
+Let windowClient be the result of running Create Window Client algorithm with the context object’s associated service worker client, visibilityState, focusState, and ancestorOrigins as the arguments.
If windowClient’s focus state is true, resolve promise with windowClient.
navigate(url)
navigate(url)
The navigate()
method must run these steps:
If url is about:blank
, return a promise rejected with a TypeError
.
If the context object’s associated service worker client's active service worker is not the context object’s relevant global object’s service worker, return a promise rejected with a TypeError
.
If the context object’s associated service worker client's active service worker is not the context object’s relevant global object’s service worker, return a promise rejected with a TypeError
.
Let promise be a new promise.
Run these substeps in parallel:
Let browsingContext be the context object’s associated service worker client's global object's browsing context.
+Let browsingContext be the context object’s associated service worker client's global object's browsing context.
If browsingContext has discarded its Document
, reject promise with a TypeError
and abort these steps.
Let ancestorOrigins be the empty array.
Queue a task task to run the following substeps on the context object’s associated service worker client's responsible event loop using the user interaction task source:
+Queue a task task to run the following substeps on the context object’s associated service worker client's responsible event loop using the user interaction task source:
HandleNavigate: Navigate browsingContext to url with exceptions enabled. The source browsing context must be browsingContext.
@@ -2596,7 +2610,7 @@enum ClientType { @@ -2634,7 +2648,7 @@secure context, reject promise with a "
SecurityError
" exception and abort these steps.
If client is a type of environment or is a window client, then:
+If client is a type of environment or is a window client, then:
Let browsingContext be null.
@@ -2656,7 +2670,7 @@Set focusState to the result of running the has focus steps with browsingContext’s active document as the argument.
If client is a window client, set ancestorOrigins to browsingContext’s active document’s relevant global object’s Location
object’s ancestor origins array.
If client is a window client, set ancestorOrigins to browsingContext’s active document’s relevant global object’s Location
object’s ancestor origins array.
Wait for task to have executed.
@@ -2728,7 +2742,7 @@If options.type
is "window"
or "all"
, and client is a type of environment or is a window client, then:
If options.type
is "window"
or "all"
, and client is a type of environment or is a window client, then:
Let browsingContext be null.
@@ -2756,7 +2770,7 @@Set focusState to the result of running the has focus steps with browsingContext’s active document as the argument.
It client is a window client, set ancestorOrigins to browsingContext’s active document’s relevant global object’s Location
object’s ancestor origins array.
It client is a window client, set ancestorOrigins to browsingContext’s active document’s relevant global object’s Location
object’s ancestor origins array.
Wait for task to have executed.
@@ -2771,7 +2785,7 @@Else if options.type
is "worker"
or "all"
and client is a dedicated worker client, or options.type
is "sharedworker"
or "all"
and client is a shared worker client, then:
Else if options.type
is "worker"
or "all"
and client is a dedicated worker client, or options.type
is "sharedworker"
or "all"
and client is a shared worker client, then:
Let clientObject be the result of running Create Client algorithm with client as the argument.
@@ -2783,11 +2797,11 @@WindowClient
objects are always placed before Client
objects whose associated service worker clients are worker clients.
WindowClient
objects are always placed before Client
objects whose associated service worker clients are worker clients.
WindowClient
objects that have been focused are placed first sorted in the most recently focused order, and WindowClient
objects that have never been focused are placed next sorted in their service worker clients' creation order.
WindowClient
objects that have been focused are placed first sorted in the most recently focused order, and WindowClient
objects that have never been focused are placed next sorted in their service worker clients' creation order.
Client
objects whose associated service worker clients are worker clients are placed next sorted in their service worker clients' creation order.
Client
objects whose associated service worker clients are worker clients are placed next sorted in their service worker clients' creation order.
Resolve promise with matchedClients.
@@ -4630,9 +4644,9 @@If client is a window client, unassociate client’s responsible document from its application cache, if it has one.
+If client is a window client, unassociate client’s responsible document from its application cache, if it has one.
Else if client is a shared worker client, unassociate client’s global object from its application cache, if it has one.
+Else if client is a shared worker client, unassociate client’s global object from its application cache, if it has one.
Note: Resources will now use the service worker registration instead of the existing application cache.
If request is a navigation request, initialize e’s targetClientId
attribute to request’s target client id, and to the empty string otherwise.
Let the isReload
attribute of e be initialized to true
if request’s client is a window client and the event was dispatched with the user’s intention for the page reload, and false
otherwise.
Let the isReload
attribute of e be initialized to true
if request’s client is a window client and the event was dispatched with the user’s intention for the page reload, and false
otherwise.
Dispatch e at activeWorker’s global object.
Let clientObject be a new Client
object.
Set clientObject’s service worker client to client.
+Set clientObject’s service worker client to client.
Set clientObject’s reserved state to true if client’s execution ready flag is unset, and false otherwise.
Let windowClient be a new WindowClient
object.
Set windowClient’s service worker client to client.
+Set windowClient’s service worker client to client.
Set windowClient’s visibility state to visibilityState.