tor-browser

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

media-devices-access.https.html (1007B)


      1 <!DOCTYPE html>
      2 <script src="/resources/testharness.js"></script>
      3 <script src="/resources/testharnessreport.js"></script>
      4 <script src="/speculation-rules/prerender/resources/utils.js"></script>
      5 <script src="/speculation-rules/prerender/resources/deferred-promise-utils.js"></script>
      6 
      7 <script>
      8 const params = new URLSearchParams(location.search);
      9 
     10 // The main test page (restriction-media-{camera, microphone}.https.html) loads
     11 // the initiator page, then the initiator page will prerender itself with the
     12 // `prerendering` parameter.
     13 const isPrerendering = params.has('prerendering');
     14 
     15 if (!isPrerendering) {
     16  const rule_extras = {'target_hint': getTargetHint()};
     17  loadInitiatorPage();
     18 } else {
     19  const prerenderEventCollector = new PrerenderEventCollector();
     20  const promise = navigator.mediaDevices.getUserMedia({
     21      audio: params.get("audio") === "true",
     22      video: params.get("video") === "true"
     23  });
     24  prerenderEventCollector.start(promise, 'navigator.mediaDevices.getUserMedia');
     25 }
     26 
     27 </script>