tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

nested-bundle.https.tentative.html (1177B)


      1 <!DOCTYPE html>
      2 <title>A nested bundle is not supported</title>
      3 <link
      4  rel="help"
      5  href="https://github.com/WICG/webpackage/blob/main/explainers/subresource-loading.md"
      6 />
      7 <script src="/resources/testharness.js"></script>
      8 <script src="/resources/testharnessreport.js"></script>
      9 <script src="../resources/test-helpers.js"></script>
     10 <body>
     11  <script type="webbundle">
     12    {
     13      "source": "/web-bundle/resources/wbn/nested-main.wbn",
     14      "resources": ["/web-bundle/resources/wbn/nested-sub.wbn"]
     15    }
     16  </script>
     17  <script>
     18    setup(() => {
     19      assert_true(HTMLScriptElement.supports("webbundle"));
     20    });
     21 
     22    promise_test(async () => {
     23      const response = await fetch("/web-bundle/resources/wbn/nested-sub.wbn");
     24      assert_true(response.ok);
     25    }, "A nested bundle can be fetched");
     26 
     27    promise_test(async () => {
     28      await addWebBundleElementAndWaitForError(
     29        "/web-bundle/resources/wbn/nested-sub.wbn",
     30        ["/web-bundle/resources/wbn/root.js"]
     31      );
     32      const response = await fetch("/web-bundle/resources/wbn/root.js");
     33      assert_false(response.ok);
     34    }, "Subresources in a nested bundle should not be loaded");
     35  </script>
     36 </body>