tor-browser

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

enumerateDevices-after-discard-1.https.html (589B)


      1 <html class="test-wait">
      2 <head>
      3  <title>
      4    Test enumerateDevices() calls either side of browsing context discard
      5  </title>
      6 </head>
      7 <script>
      8  const frame = document.createElement('frame');
      9  document.documentElement.appendChild(frame);
     10  const devices = frame.contentWindow.navigator.mediaDevices;
     11  devices.enumerateDevices();
     12  frame.remove();
     13  devices.enumerateDevices();
     14  // Wait long enough to expect the async enumerateDevices() code to complete.
     15  navigator.mediaDevices.enumerateDevices().then(
     16    () => document.documentElement.removeAttribute("class"));
     17 </script>
     18 </html>