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
1. Let |script| be |serviceWorker|'s [=service worker/script resource=].
2854
2854
1. Assert: |script| is not null.
2855
2855
1. Let |startFailed| be false.
2856
-
1. Create a separate parallel execution environment (i.e. a separate thread or process or equivalent construct), and run the following steps in that context:
2857
-
1. Call the JavaScript [=InitializeHostDefinedRealm|InitializeHostDefinedRealm()=]abstract operation with the following customizations:
2856
+
1. Let |agent| be the result of [=obtain a service worker agent|obtaining a service worker agent=], and run the following steps in that context:
2857
+
1. Let |realmExecutionContext| be the result of [=create a new JavaScript realm|creating a new JavaScript realm=]given |agent| and the following customizations:
2858
2858
* For the global object, create a new {{ServiceWorkerGlobalScope}} object. Let |workerGlobalScope| be the created object.
2859
-
* Let |realmExecutionContext| be the created [=execution context|JavaScript execution context=].
2860
2859
1. Set |serviceWorker|'s [=service worker/global object=] to |workerGlobalScope|.
2861
-
1. Let |workerEventLoop| be a newly created <a>event loop</a>.
2862
2860
1. Let |settingsObject| be a new <a>environment settings object</a> whose algorithms are defined as follows:
2863
2861
2864
2862
: The [=environment settings object/realm execution context=]
2865
2863
:: Return |realmExecutionContext|.
2866
-
: The [=environment settings object/global object=]
2867
-
:: Return |workerGlobalScope|.
2868
-
: The <a>responsible event loop</a>
2869
-
:: Return |workerEventLoop|.
2870
-
: The [=environment settings object/referrer policy=]
1. Set |settingsObject|'s [=environment/id=] to a new unique opaque string, its [=creation URL=] to |serviceWorker|'s [=service worker/script url=], its [=environment/target browsing context=] to null, and its [=active service worker=] to null.
2883
2878
1. Set |workerGlobalScope|'s [=WorkerGlobalScope/url=] to |serviceWorker|'s [=service worker/script url=].
2884
2879
1. Set |workerGlobalScope|'s [=WorkerGlobalScope/HTTPS state=] to |serviceWorker|'s <a>script resource</a>'s <a>HTTPS state</a>.
2885
2880
1. Set |workerGlobalScope|'s [=WorkerGlobalScope/referrer policy=] to |serviceWorker|'s <a>script resource</a>'s [=script resource/referrer policy=].
0 commit comments