tor-browser

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

file_autoplay_policy_activation_frame.html (961B)


      1 <!DOCTYPE HTML>
      2 <html>
      3  <head>
      4    <title>Autoplay policy frame</title>
      5    <script type="text/javascript" src="manifest.js"></script>
      6    <script type="text/javascript" src="AutoplayTestUtils.js"></script>
      7    <script src="/tests/SimpleTest/EventUtils.js"></script>
      8    <style>
      9      video {
     10        width: 50%;
     11        height: 50%;
     12      }
     13    </style>
     14  </head>
     15  <body>
     16    <script>
     17      window.addEventListener("message",
     18        (event) => {
     19          if (event.data == "click") {
     20            SpecialPowers.wrap(document).notifyUserGestureActivation();
     21            event.source.postMessage("activated", "*");
     22          } else if (event.data == "play-audible") {
     23            playAndPostResult(false, event.source);
     24          } else if (event.data == "play-muted") {
     25            playAndPostResult(true, event.source);
     26          }
     27        });
     28      let w = window.opener || window.parent;
     29      w.postMessage("ready", "*");
     30    </script>
     31  </body>
     32 </html>