SharedArrayBuffer
Warning
This post is more than a year old. Information may be outdated.
SharedArrayBuffer is an object that holds a fixed-length binary buffer. You can pass around comparably longer data with SharedArrayBuffer between agents (i.e., main thread and worker.) A change in one ShardArrayBuffer will reflect on the other side.
The Spectre vulnerability seized ShardArrayBuffer in 2018, and since 2020, ShardArrayBuffer requires a Secure Context to run.
For the host document, I need two headers to enable ShardArrayBuffer.