tor-browser

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

autoplay-disabled-by-csp.html (1078B)


      1 <!DOCTYPE html>
      2 <html>
      3  <head>
      4  <link rel="help" href="https://html.spec.whatwg.org/multipage/#eligible-for-autoplay" />
      5  <title>Test that autoplay is blocked by a document's active sandboxing flags</title>
      6  <script src="/resources/testharness.js"></script>
      7  <script src="/resources/testharnessreport.js"></script>
      8  <script src='../support/logTest.sub.js?logs=["Loaded iframe"]'></script>
      9  <script src="/common/media.js"></script>
     10  </head>
     11  <body>
     12    <iframe id="iframe" src="support/autoplay.html"></iframe>
     13    <script>
     14      async_test((t) => {
     15        iframe.addEventListener('load', () => {
     16          log('Loaded iframe');
     17          var v = iframe.contentWindow.document.getElementById('v');
     18 
     19          v.addEventListener('playing', t.unreached_func(
     20            'video should not autoplay due to sandboxing flags'
     21          ));
     22 
     23          v.src = getVideoURI('/media/movie_5') + '?' + new Date() + Math.random()
     24          t.step_timeout(() => t.done(), 500);
     25        });
     26      }, 'csp-derived sandboxing flags prevent autoplay.')
     27    </script>
     28  </body>
     29 </html>