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, M103-M104

    Note: M102 is excluded.

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”).

The old APIs

Chrome M90 - M101 supported <link>-based API, a urn:uuid URL and the old WebBundle format “b1”. however, they were removed in M102.

This guide no longer covers the old APIs. If you are still using the old APIs, 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.