Origin Trial for Subresource Loading with Web Bundles

This document is for web developers who want to participate in Origin Trial for Subresource Loading with Web Bundles.

Origin Trial timeline

  • Chrome M90-M101

How to create a bundle

There are several tools available.

What works in Chrome M97+

<script>-based API

Example:

<script type="webbundle">
{
  source: "https://example.com/dir/subresources.wbn",
  credentials: "include",
  resources: ["a.js", "b.js", "c.png"],
  scopes: ["css"]
}
</script>

uuid-in-package URL

Example:

<script type="webbundle">
{
  source: "https://example.com/dir/subresources.wbn",
  resources: ["uuid-in-package:f81d4fae-7dec-11d0-a765-00a0c91e6bf6"],
}
</script>

<iframe src="uuid-in-package:f81d4fae-7dec-11d0-a765-00a0c91e6bf6"></iframe>

Web Bundles format version “b2”

Chrome M97+ supports the latest Web Bundles format (called as “b2”).

What works in Chrome M90 or later.

Chrome M90+ supports a <link>-based API, a urn:uuid URL and the old WebBundle format “b1”. They are still supported in Chrome M97+, however, we strongly recommend origin trial participants to use new APIs in Chrome M97+.

This guide no longer covers the old APIs, which we plan to remove eventually. Please see the previous revision of this guide for the old APIs and the migration guide.

Feature detection

You can use HTMLScriptElement.supports(type) for feature detection.

if (HTMLScriptElement.supports("webbundle")) {
   // Supported
   ...
} else {
   // Unsupported
   ...
}

How to try this feature locally

Enable Experimental Web Platform Features flag (chrome://flags/#enable-experimental-web-platform-features). Note that an earlier version of Chrome might not support this feature.