You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is off by default to exclude them when frozen. Since postMessage
will be delayed until the page is unfrozen this is the safest option
to exclude frozen pages by default.
A {{Client}} object has an associated <dfn id="dfn-service-worker-client-frame-type" for="Client">frame type</dfn>, which is one of "`auxiliary`", "`top-level`", "`nested`", and "`none`". Unless stated otherwise it is "`none`".
1075
1080
1081
+
A {{Client}} object has an associated <dfn id="dfn-service-worker-client-state" for="Client">client state</dfn>, which is one of "`active`", and "`frozen`". Unless stated otherwise it is "`active`".
1082
+
1076
1083
A {{WindowClient}} object has an associated <dfn id="dfn-service-worker-client-browsing-context" for="WindowClient">browsing context</dfn>, which is its [=Client/service worker client=]'s [=environment settings object/global object=]'s [=/browsing context=].
1077
1084
1078
1085
A {{WindowClient}} object has an associated <dfn id="dfn-service-worker-client-visibilitystate">visibility state</dfn>, which is one of {{Document/visibilityState}} attribute value.
1. [=Queue a task=] to run the following steps on the [=context object=]'s associated [=Client/service worker client=]'s [=responsible event loop=] using the [=user interaction task source=]:
1177
1190
1. Run the [=focusing steps=] with the [=context object=]'s [=WindowClient/browsing context=].
1178
1191
1. Let |frameType| be the result of running [=Get Frame Type=] with the [=context object=]'s [=WindowClient/browsing context=].
1192
+
1. Let |state| be the result of running [=Get Client State=] with [=context object=]'s associated [=Client/service worker client=].
1179
1193
1. Let |visibilityState| be the [=context object=]'s [=WindowClient/browsing context=]'s [=active document=]'s {{Document/visibilityState}} attribute value.
1180
1194
1. Let |focusState| be the result of running the [=has focus steps=] with the [=context object=]'s [=WindowClient/browsing context=]'s [=active document=].
1181
1195
1. Let |ancestorOriginsList| be the [=context object=]'s [=WindowClient/browsing context=]'s [=active document=]'s [=relevant global object=]'s {{Location}} object's [=Location/ancestor origins list=]'s associated list.
1182
1196
1. [=Queue a task=] to run the following steps on |serviceWorkerEventLoop| using the [=DOM manipulation task source=]:
1183
-
1. Let |windowClient| be the result of running [=Create Window Client=] with the [=context object=]'s associated [=Client/service worker client=], |frameType|, |visibilityState|, |focusState|, and |ancestorOriginsList|.
1197
+
1. Let |windowClient| be the result of running [=Create Window Client=] with the [=context object=]'s associated [=Client/service worker client=], |frameType|, |visibilityState|, |focusState|, |ancestorOriginsList|, and |state|.
1184
1198
1. If |windowClient|'s [=focus state=] is true, resolve |promise| with |windowClient|.
1. *HandleNavigate*: [=Navigate=] |browsingContext| to |url| with [=exceptions enabled flag|exceptions enabled=]. The [=source browsing context=] must be |browsingContext|.
1204
1218
1. If the algorithm steps invoked in the step labeled *HandleNavigate* [=throws=] an exception, [=queue a task=] to reject |promise| with the exception, on |serviceWorkerEventLoop| using the [=DOM manipulation task source=], and abort these steps.
1205
1219
1. Let |frameType| be the result of running [=Get Frame Type=] with |browsingContext|.
1220
+
1. Let |state| be the result of running [=Get Client State=] with [=context object=]'s associated [=Client/service worker client=].
1206
1221
1. Let |visibilityState| be |browsingContext|'s <a>active document</a>'s {{Document/visibilityState}} attribute value.
1207
1222
1. Let |focusState| be the result of running the [=has focus steps=] with |browsingContext|'s [=active document=].
1208
1223
1. Let |ancestorOriginsList| be |browsingContext|'s [=active document=]'s [=relevant global object=]'s {{Location}} object's [=Location/ancestor origins list=]'s associated list.
1209
1224
1. [=Queue a task=] to run the following steps on |serviceWorkerEventLoop| using the [=DOM manipulation task source=]:
1210
1225
1. If |browsingContext|'s {{Window}} object's <a>environment settings object</a>'s <a>creation URL</a>'s [=url/origin=] is not the <a lt="same origin">same</a> as the [=ServiceWorkerGlobalScope/service worker=]'s [=environment settings object/origin=], resolve |promise| with null and abort these steps.
1211
-
1. Let |windowClient| be the result of running [=Create Window Client=] with the [=context object=]'s [=Client/service worker client=], |frameType|, |visibilityState|, |focusState|, and |ancestorOriginsList|.
1226
+
1. Let |windowClient| be the result of running [=Create Window Client=] with the [=context object=]'s [=Client/service worker client=], |frameType|, |visibilityState|, |focusState|, |ancestorOriginsList|, and |state|.
1. If |options|["{{ClientQueryOptions/includeUncontrolled}}"] is false, and if |client|'s [=active service worker=] is not the associated [=ServiceWorkerGlobalScope/service worker=], [=continue=].
1274
1297
1. Add |client| to |targetClients|.
1275
1298
1. Let |matchedWindowData| be a new [=list=].
1276
-
1. Let |matchedClients| be a new [=list=].
1299
+
1. Let |matchedClientData| be a new [=list=].
1277
1300
1. For each [=/service worker client=] |client| in |targetClients|:
1301
+
1. Let |state| be the result of running [=Get Client State=] with |client|.
1302
+
1. If |options|["{{ClientQueryOptions/type}}"] is not {{ClientType/"all"}} and does not equal |state|, then [=continue=].
1278
1303
1. If |options|["{{ClientQueryOptions/type}}"] is {{ClientType/"window"}} or {{ClientType/"all"}}, and |client| is not an [=environment settings object=] or is a [=window client=], then:
1279
-
1. Let |windowData| be «[ "client" → |client|, "ancestorOriginsList" → a new [=list=] ]».
1304
+
1. Let |windowData| be «[ "client" → |client|, "ancestorOriginsList" → a new [=list=], "state" → |state| ]».
1280
1305
1. Let |browsingContext| be null.
1281
1306
1. Let |isClientEnumerable| be true.
1282
1307
1. If |client| is an [=environment settings object=], set |browsingContext| to |client|'s [=environment settings object/global object=]'s [=/browsing context=].
1. Else if |options|["{{ClientQueryOptions/type}}"] is {{ClientType/"worker"}} or {{ClientType/"all"}} and |client| is a [=dedicated worker client=], or |options|["{{ClientQueryOptions/type}}"] is {{ClientType/"sharedworker"}} or {{ClientType/"all"}} and |client| is a [=shared worker client=], then:
1. [=Queue a task=] to run the following steps on |promise|'s [=relevant settings object=]'s [=responsible event loop=] using the [=DOM manipulation task source=]:
1300
1325
1. Let |clientObjects| be a new [=list=].
1301
1326
1. [=list/For each=] |windowData| in |matchedWindowData|:
1302
-
1. Let |windowClient| be the result of running [=Create Window Client=] algorithm with |windowData|["`client`"], |windowData|["`frameType`"], |windowData|["`visibilityState`"], |windowData|["`focusState`"], and |windowData|["`ancestorOriginsList`"] as the arguments.
1327
+
1. Let |windowClient| be the result of running [=Create Window Client=] algorithm with |windowData|["`client`"], |windowData|["`frameType`"], |windowData|["`visibilityState`"], |windowData|["`focusState`"], |windowData|["`ancestorOriginsList`"], and |windowData|["`state`"] as the arguments.
1303
1328
1. [=Append=] |windowClient| to |clientObjects|.
1304
-
1. [=list/For each=] |client| in |matchedClients|:
1305
-
1. Let |clientObject| be the result of running [=Create Client=] algorithm with |client| as the argument.
1329
+
1. [=list/For each=] |clientData| in |matchedClientData|:
1330
+
1. Let |clientObject| be the result of running [=Create Client=] algorithm with |clientData|["`client`"], and |clientData|["`state`"] as the arguments.
1306
1331
1. [=Append=] |clientObject| to |clientObjects|.
1307
1332
1. Sort |clientObjects| such that:
1308
1333
* {{WindowClient}} objects whose [=WindowClient/browsing context=] has been [=focusing steps|focused=] are placed first, sorted in the most recently [=focusing steps|focused=] order.
1. If the algorithm steps invoked in the step labeled *HandleNavigate* [=throws=] an exception, [=queue a task=] to reject |promise| with the exception, on |serviceWorkerEventLoop| using the [=DOM manipulation task source=], and abort these steps.
1333
1358
1. Let |frameType| be the result of running [=Get Frame Type=] with |newContext|.
1334
1359
1. Let |visibilityState| be |newContext|'s <a>active document</a>'s {{Document/visibilityState}} attribute value.
1360
+
1. Let |state| be the result of running [=Get Client State=] with [=context object=]'s associated [=Client/service worker client=].
1335
1361
1. Let |focusState| be the result of running the <a>has focus steps</a> with |newContext|'s <a>active document</a> as the argument.
1336
1362
1. Let |ancestorOriginsList| be |newContext|'s <a>active document</a>'s <a>relevant global object</a>'s {{Location}} object's [=Location/ancestor origins list=]'s associated list.
1337
1363
1. [=Queue a task=] to run the following steps on |serviceWorkerEventLoop| using the [=DOM manipulation task source=]:
1338
1364
1. If |newContext|'s {{Window}} object's [=environment settings object=]'s [=creation URL=]'s [=environment settings object/origin=] is not the [=same origin|same=] as the [=ServiceWorkerGlobalScope/service worker=]'s [=environment settings object/origin=], resolve |promise| with null and abort these steps.
1339
-
1. Let |client| be the result of running [=Create Window Client=] with |newContext|'s {{Window}} object's [=environment settings object=], |frameType|, |visibilityState|, |focusState|, and |ancestorOriginsList| as the arguments.
1365
+
1. Let |client| be the result of running [=Create Window Client=] with |newContext|'s {{Window}} object's [=environment settings object=], |frameType|, |visibilityState|, |focusState|, |ancestorOriginsList|, and |state| as the arguments.
1. If |client| is not a [=secure context=], [=queue a task=] to reject |promise| with a "{{SecurityError}}" {{DOMException}}, on |promise|'s [=relevant settings object=]'s [=responsible event loop=] using the [=DOM manipulation task source=], and abort these steps.
3354
3384
1. Else:
3355
3385
1. If |client|’s [=creation URL=] is not a [=potentially trustworthy URL=], [=queue a task=] to reject |promise| with a "{{SecurityError}}" {{DOMException}}, on |promise|'s [=relevant settings object=]'s [=responsible event loop=] using the [=DOM manipulation task source=], and abort these steps.
3386
+
1. Let |state| be the result of running [=Get Client State=] with |client|.
3356
3387
1. If |client| is an [=environment settings object=] and is not a [=window client=], then:
3357
-
1. Let |clientObject| be the result of running [=Create Client=] algorithm with |client|as the argument.
3388
+
1. Let |clientObject| be the result of running [=Create Client=] algorithm with |client|, and |state| as the arguments.
3358
3389
1. [=Queue a task=] to resolve |promise| with |clientObject|, on |promise|'s [=relevant settings object=]'s [=responsible event loop=] using the [=DOM manipulation task source=], and abort these steps.
1. If |client| is a [=window client=], set |ancestorOriginsList| to |browsingContext|'s [=active document=]'s [=relevant global object=]'s {{Location}} object's [=Location/ancestor origins list=]'s associated list.
3369
3400
1. [=Queue a task=] to run the following steps on |promise|'s [=relevant settings object=]'s [=responsible event loop=] using the [=DOM manipulation task source=]:
3370
3401
1. If |client|'s [=discarded flag=] is set, resolve |promise| with undefined and abort these steps.
3371
-
1. Let |windowClient| be the result of running [=Create Window Client=] with |client|, |frameType|, |visibilityState|, |focusState|, and |ancestorOriginsList|.
3402
+
1. Let |windowClient| be the result of running [=Create Window Client=] with |client|, |frameType|, |visibilityState|, |focusState|, |ancestorOriginsList| and |state|.
Note: When an exception is [=throw|thrown=], the implementation does undo (roll back) any changes made to the cache storage during the batch operation job.
0 commit comments