Skip to content

Restore data: URL matching for shared workers via constructor storage key#12680

Merged
annevk merged 2 commits into
mainfrom
shared-worker-constructor-storage-key
Jul 13, 2026
Merged

Restore data: URL matching for shared workers via constructor storage key#12680
annevk merged 2 commits into
mainfrom
shared-worker-constructor-storage-key

Conversation

@annevk

@annevk annevk commented Jul 13, 2026

Copy link
Copy Markdown
Member

When the shared worker lookup was changed to compare storage keys (5aa1a59), the SharedWorkerGlobalScope constructor origin comparison was dropped. The replacement derived the worker storage key from the worker's own settings object, but a data: URL worker has a unique opaque origin, so its storage key could never equal the creating environment's. This meant a data: URL shared worker could never be found and reused, even by the page that created it, and it left the constructor origin concept referenced only by a now-inaccurate note.

Replace the constructor origin concept with a constructor storage key, initialized from the creating environment's storage key, and compare that against the outside storage key during lookup. This restores data: URL reuse while respecting storage key partitioning (origin and top-level site), and fixes the note.


Skipping the template as this is a regression fix. This behavior was never intended to be changed.


/workers.html ( diff )

… key

When the shared worker lookup was changed to compare storage keys
(5aa1a59), the SharedWorkerGlobalScope constructor origin comparison was
dropped. The replacement derived the worker storage key from the worker's
own settings object, but a data: URL worker has a unique opaque origin, so
its storage key could never equal the creating environment's. This meant a
data: URL shared worker could never be found and reused, even by the page
that created it, and it left the constructor origin concept referenced only
by a now-inaccurate note.

Replace the constructor origin concept with a constructor storage key,
initialized from the creating environment's storage key, and compare that
against the outside storage key during lookup. This restores data: URL
reuse while respecting storage key partitioning (origin and top-level
site), and fixes the note.

@domfarolino domfarolino left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks!

@annevk
annevk merged commit a6d8d17 into main Jul 13, 2026
2 checks passed
@annevk
annevk deleted the shared-worker-constructor-storage-key branch July 13, 2026 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants