From 5aa1a598e9ed50480436f75697b05863789e3f31 Mon Sep 17 00:00:00 2001 From: Ben Kelly Date: Wed, 15 Jun 2022 13:09:56 -0400 Subject: [PATCH] Compare against storage key when creating a shared worker This is technically not a normative change right now, but it will be when https://github.com/whatwg/storage/pull/144 lands. --- source | 48 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 10 deletions(-) diff --git a/source b/source index 4a28a2dcd2d..cd7dc3f8b10 100644 --- a/source +++ b/source @@ -105160,6 +105160,9 @@ interface SharedWorker : EventTarget {
  • Let callerIsSecureContext be true if outside settings is a secure context; otherwise, false.

  • +
  • Let outside storage key be the result of running obtain a storage key + for non-storage purposes given outside settings.

  • +
  • Enqueue the following steps to the shared worker manager:

    @@ -105167,16 +105170,41 @@ interface SharedWorker : EventTarget {
  • Let worker global scope be null.

  • -

    If there exists a SharedWorkerGlobalScope object whose closing flag is false, constructor origin is - same origin with outside settings's origin, constructor url equals urlRecord, and name equals the value of options's - name member, then set worker global scope to that - SharedWorkerGlobalScope object.

    +

    For each scope in the list of all + SharedWorkerGlobalScope objects:

    + +
      +
    1. Let worker storage key be the result of running obtain a storage + key for non-storage purposes given scope's relevant settings + object.

    2. + +
    3. +

      If all of the following conditions are true:

      + +
        +
      • worker storage key equals + outside storage key;
      • + +
      • scope's closing flag + is false;
      • + +
      • scope's + constructor url equals + urlRecord; and
      • + +
      • scope's name equals + the value of option's name member
      • +
      + +

      then:

      + +
        +
      1. Set worker global scope to scope.

      2. + +
      3. Break.

      4. +
      +
    4. +

    data: URLs create a worker with an opaque origin. Both the