tor-browser

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

test_register_https_in_http.html (1259B)


      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  <title>Bug 1172948 - Test that registering a service worker from inside an HTTPS iframe embedded in an HTTP iframe doesn't work</title>
      9  <script src="/tests/SimpleTest/SimpleTest.js"></script>
     10  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
     11 </head>
     12 <body>
     13 <p id="display"></p>
     14 <div id="content" style="display: none">
     15 </div>
     16 <pre id="test"></pre>
     17 <script class="testbody" type="text/javascript">
     18 
     19  function runTest() {
     20    var iframe = document.createElement("iframe");
     21    iframe.src = "https://example.com/tests/dom/serviceworkers/test/register_https.html";
     22    document.body.appendChild(iframe);
     23 
     24    window.onmessage = event => {
     25      switch (event.data.type) {
     26      case "ok":
     27        ok(event.data.status, event.data.msg);
     28        break;
     29      case "done":
     30        SimpleTest.finish();
     31        break;
     32      }
     33    };
     34  }
     35 
     36  SimpleTest.waitForExplicitFinish();
     37  onload = function() {
     38    SpecialPowers.pushPrefEnv({"set": [
     39      ["dom.serviceWorkers.exemptFromPerDomainMax", true],
     40      ["dom.serviceWorkers.enabled", true],
     41    ]}, runTest);
     42  };
     43 </script>
     44 </body>
     45 </html>