v150 · Security · Workers
Opaque origin for data: URL Dedicated and Shared Workers
Chrome 150 aligns with the HTML specification: workers created from data: URLs now receive a unique opaque origin instead of inheriting their creator's origin. This closes a security gap that allowed data: URL workers to access origin-sensitive storage and channels as if they were same-origin with the page.
concepts
-
Origin Isolation Demo
Live comparison of worker origin before and after Chrome 150. Creates a
data:URL worker, reportsself.origin, tests whether aBroadcastChannelmessage reaches the page, notes workerlocalStorageexposure, and probesIndexedDBaccess — showing the transition from inherited origin to"null"(opaque). -
Migration Patterns
Side-by-side before/after code for the three most common patterns that break: cross-worker messaging via
BroadcastChannel, shared storage access, and inline scripts. Each pattern has a live runner that compares thedata:URL behavior with itsBlobURL migration. -
data: URL Worker Test
Spins up a real worker from a
data:URL and probesself.originlive. Tests whetherBroadcastChannel,localStorage, andIndexedDBare accessible — all blocked for the opaque null origin Chrome 150 assigns. -
Communication Tester
Runs six targeted tests against a live
data:URL worker:postMessage,BroadcastChannel,self.originprobe,localStorage, transferableArrayBuffer, and a Blob URL worker for comparison. Each test shows a pass/fail badge and the observed value — making it easy to see exactly which APIs break under the null-origin rule. -
Blob URL Converter
Paste any worker script into the converter and get back the Blob URL pattern that makes it Chrome 150–compatible. Detects
BroadcastChannel,localStorage, andindexedDBusage and warns when migration is required. Live test button creates the Blob URL worker and sends a real message so you can verify the output. -
Security Audit Tool
Creates a real
data:URL worker and probes the four security boundaries:self.origin,BroadcastChannel,localStorage, andIndexedDB. In Chrome 150, all return null origin or throwSecurityError— demonstrating that the old attack surface is closed. Also shows the pre-150 attack pattern that made data: URL workers dangerous.
why it shipped
Workers created from data: URLs — like new Worker('data:text/javascript,...') — should logically be isolated: a self-contained blob of code with no inherent relationship to any server origin. The HTML specification says these workers must get an opaque (null) origin. But Chrome had historically made them inherit the page's origin, letting them join BroadcastChannel queues, read from localStorage, and query IndexedDB as if they were part of the page. Firefox and Safari never had this gap. Chrome 150 fixes it, completing the interoperability story. Sites that relied on the old behaviour — for example, a data: URL worker that posts to a named BroadcastChannel shared with the main thread — will need to replace the worker URL with a Blob URL constructed from the same source code. The functionality is identical; only the URL scheme changes.
references
implementation reference
Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗