WebContainers Browser Support
Last update: February 2023
Supported browsers
WebContainers are supported in all recent desktop browsers (fully in Chrome and Chrome-based browsers, in beta in Firefox and Safari), and partially supported on Android browsers.
Desktop browsers
- Chrome: full support.
- Other Chromium-based browsers: full support. Some browsers may apply restrictive rules by default, and require specific configuration, like Brave.
- Firefox: beta support (see details).
- Safari: beta support since Safari 16.4, no support for earlier versions (see details).
Mobile browsers
- Android: beta support for Chrome, Chromium-based browsers and Firefox. Depending on your device, large projects may run into memory limitations.
- iOS and iPadOS: beta support for Safari since iOS 16.4. Large projects may run into memory limitations because the memory usage for a web page on a mobile device is more constrained. In this case, you may experience reduced performance.
Web Platform requirements
StackBlitz requires some of the latest additions to the Web Platform to work correctly when running WebContainers-based projects. Most important among them are SharedArrayBuffer and cross-origin isolation.
Cross-origin isolation
SharedArrayBuffers (SABs) allow simultaneous access to a chunk of memory from multiple different contexts.
Cross-origin isolation is the key to enabling SABs: by properly configuring some of the headers and controlling which resources are served to browsers, a site can be considered crossOriginIsolated. This is required for WebContainers to function correctly in the browser.
However, for cross-origin isolation to work for our use case, you need to be able to embed arbitrary resources: to be able to write and test your web application seamlessly, regardless of which image, script, or asset you are using.
Unfortunately, this feature is only enabled in Chromium-based browsers. We are following current specifications and continuing our talks with browser implementors to bring support to other browsers.
You can read more about cross-origin isolation on our blog.
JS engine differences
Note that there might be minor differences in the behavior of WebContainers in browsers that are not based on Chromium. After all, WebContainers strive for maximum compatibility with Node.js, which itself runs on different JavaScript engines in different browsers.
Chrome
WebContainers are fully supported in Chrome and most Chromium-based browsers including Brave, Edge, Vivaldi, and others.
However, if you enabled blocking third-party cookies in Chrome preferences, this may prevent WebContainers from working out of the box.
If you think you’re running into this issue, check out how to configure Chrome to run WebContainers.
Brave
Brave is a Chromium-based browser and supports WebContainers well but it ships with a more aggressive third-party blocking by default which tends to stop WebContainers from running.
Learn how to configure Brave to run WebContainers.
Firefox
We have beta support for Firefox. Please try it and share feedback with us!
Firefox does not fully support the required mode for cross-origin isolation, so you might encounter limitations when running a server in a preview frame within the StackBlitz editor. Third-party cookies and privacy features can also impact the experience.
If you are using Firefox Private Browsing, it's not possible to run a web server. The reason is that we need to be able to use a Service Worker, which Firefox does not allow in Private Browsing without additional configuration.
Because Firefox and Node.js use different JavaScript engines (SpiderMonkey and V8, respectively), there is a small risk of running into JS engine differences.
Safari
We have beta support for Safari on macOS, starting with Safari 16.4. Please try it and report issues here.
Safari does not fully support the required mode for cross-origin isolation, so you might encounter limitations when running a server in a preview frame within the StackBlitz editor. Third-party cookies and privacy features can also impact the experience.
Because Safari and Node.js use different JavaScript engines (JavaScriptCore and V8, respectively), there is a small risk of running into JS engine differences.
Older Safari versions are not supported. They lack a few necessary Web Platform features, such as Atomics.waitAsync and lookbehind in regular expressions.
Embedding
Projects based on WebContainers can be embedded as any other StackBlitz project. However, the restrictions detailed above hit harder in embedded contexts.
For that reason, we only support embedding WebContainers-based projects in Chromium-based browsers.