This document is for web developers who want to participate in Origin Trial for Subresource Loading with Web Bundles.
There are several tools available.
<script>-based APIExample:
<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 URLExample:
<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>
Chrome M97+ supports the latest Web Bundles format (called as “b2”).
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.
You can use HTMLScriptElement.supports(type) for feature detection.
if (HTMLScriptElement.supports("webbundle")) { // Supported ... } else { // Unsupported ... }
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.