tor-browser

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

secure-iframe-in-insecure-context.html (1206B)


      1 <!DOCTYPE html>
      2 <html>
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <script src="/common/get-host-info.sub.js"></script>
      6 <script src="resources/observe-entry.js"></script>
      7 
      8 <body>
      9 </body>
     10 <script>
     11  const { HTTPS_ORIGIN } = get_host_info();
     12 
     13  promise_test(async t => {
     14    const iframe = document.createElement('iframe');
     15    iframe.src = `${HTTPS_ORIGIN}/resource-timing/resources/200.https.asis?1`;
     16    document.body.appendChild(iframe);
     17    t.add_cleanup(() => iframe.remove());
     18    const entry = await observe_entry(iframe.src);
     19    assert_not_equals(entry.secureConnectionStart, 0);
     20  }, 'secureConnectionStart is reported for iframes loaded over https in http context');
     21 
     22  promise_test(async t => {
     23    const object = document.createElement('object');
     24    object.data = `${HTTPS_ORIGIN}/resource-timing/resources/200.https.asis?2`;
     25    document.body.appendChild(object);
     26    t.add_cleanup(() => object.remove());
     27    const entry = await observe_entry(object.data);
     28    assert_not_equals(entry.secureConnectionStart, 0);
     29  }, 'secureConnectionStart is reported for object documents loaded over https in http context');
     30 </script>
     31 
     32 </html>