← Back to release summary

ShadowRealm

Category
JavaScript
Type
Chromium catches up
Status
In development (Chrome In development)
Intent stage
Start prototyping

WPT details: Tested in test262: https://github.com/tc39/test262/tree/main/test/built-ins/ShadowRealm Various tests in WPT for shadow realms integration with other web standards.

Summary

ShadowRealm is a TC39 proposal to add an in-process, synchronous way to create a new global environment with its own global object and its own set of built-ins and intrinsics. See the proposal explainer at https://github.com/tc39/proposal-shadowrealm/blob/main/explainer.md

Motivation

The ShadowRealm API provides a way to run trusted code in a fresh global environment, which has use cases for virtualization, virtual DOM, and other execution of trusted 3rd party code. Please note that because ShadowRealm is a synchronous, in-process (e.g. no separate address space protection) API, it is not a sufficient security boundary for many threat models. It is not a generic sandboxing primitive for security purposes.

Standards & signals

Ecosystem

Docs: https://docs.google.com/document/d/1SWFGpiSdrBwErDNot8rqMyBjKGC3WDArcLnGg7MX6SE/edit?usp=sharing https://docs.google.com/document/d/1k9OZxtbKmzENOMzahmm2C0uBNRc_pVLXMSoKsrkJJBw/edit?usp=sharing

Explainers: https://github.com/tc39/proposal-shadowrealm/blob/main/explainer.md

View on chromestatus.com