tor-browser

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

test_referrer_header_worker.html (1197B)


      1 <!--
      2  Any copyright is dedicated to the Public Domain.
      3  http://creativecommons.org/publicdomain/zero/1.0/
      4 -->
      5 <!DOCTYPE HTML>
      6 <html>
      7 <head>
      8  <meta charset="utf-8">
      9  <title>Test the referrer of workers</title>
     10  <script src="/tests/SimpleTest/SimpleTest.js"></script>
     11  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
     12 </head>
     13 <body>
     14  <script class="testbody" type="text/javascript">
     15    SimpleTest.waitForExplicitFinish();
     16 
     17    SpecialPowers.pushPrefEnv(
     18      {"set": [
     19         ['security.mixed_content.block_display_content', false],
     20         ['security.mixed_content.block_active_content', false]
     21      ]},
     22      function() {
     23        SpecialPowers.pushPermissions([{'type': 'systemXHR', 'allow': true, 'context': document}], test);
     24    });
     25 
     26    function test() {
     27      function messageListener(event) {
     28        // eslint-disable-next-line no-eval
     29        eval(event.data);
     30      }
     31      window.addEventListener("message", messageListener);
     32 
     33      var ifr = document.createElement('iframe');
     34      ifr.setAttribute('src', 'https://example.com/tests/dom/workers/test/referrer_worker.html');
     35      document.body.appendChild(ifr);
     36    }
     37  </script>
     38 </body>
     39 </html>