tor-browser

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

sandboxed-video.html (855B)


      1 <!doctype html>
      2 <title>Test load of media document in sandboxed iframe</title>
      3 <link rel="motivation" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1783601">
      4 <script src=/resources/testharness.js></script>
      5 <script src=/resources/testharnessreport.js></script>
      6 <body></body>
      7 <script>
      8 promise_test(async () => {
      9  const frame = document.createElement('iframe');
     10  frame.sandbox = '';
     11  frame.src =
     12    // 'PartialContent' ensures that the entire video resource does not load
     13    // in one fetch.
     14    '/service-workers/service-worker/resources/fetch-access-control.py?'
     15    + 'VIDEO&PartialContent';
     16 
     17  document.body.appendChild(frame);
     18  await new Promise(resolve => frame.onload = resolve);
     19 
     20  const video = SpecialPowers.wrap(frame).contentDocument.body.childNodes[0];
     21  video.muted = true;  // to allow playback
     22  return video.play();
     23 });
     24 </script>