tor-browser

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

web-serial.https.html (1064B)


      1 <!DOCTYPE html>
      2 <script src="/common/utils.js"></script>
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <script src="/speculation-rules/prerender/resources/utils.js"></script>
      6 <script src="/speculation-rules/prerender/resources/deferred-promise-utils.js"></script>
      7 <script>
      8 
      9 const params = new URLSearchParams(location.search);
     10 
     11 // The main test page (restriction-web-serial.https.html) loads the
     12 // initiator page, then the initiator page will prerender itself with the
     13 // `prerendering` parameter.
     14 const isPrerendering = params.has('prerendering');
     15 
     16 if (!isPrerendering) {
     17  loadInitiatorPage();
     18 } else {
     19  const prerenderEventCollector = new PrerenderEventCollector();
     20  // The spec, https://wicg.github.io/nav-speculation/prerendering.html#patch-serial,
     21  // says that Web Serial API has delay while prerendering for
     22  // requestPort(). As this test uses getPorts(), it's a tentative test.
     23  prerenderEventCollector.start(
     24      navigator.serial.getPorts(), 'navigator.serial.getPorts');
     25 }
     26 
     27 </script>