tor-browser

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

sandbox-allow-same-origin.html (1136B)


      1 <!DOCTYPE html>
      2 <html>
      3  <head>
      4    <title>DOM access in sandbox="allow-same-origin" iframe</title>
      5    <link rel="author" title="Kinuko Yasuda" href="mailto:kinuko@chromium.org">
      6    <link rel="help" href="http://www.w3.org/html/wg/drafts/html/master/browsers.html#sandboxing">
      7    <script src="/resources/testharness.js"></script>
      8    <script src="/resources/testharnessreport.js"></script>
      9  </head>
     10 
     11  <body>
     12    <h1>DOM access in sandbox="allow-same-origin" iframe</h1>
     13    <script type="text/javascript">
     14      var t = async_test("DOM access in sandbox='allow-same-origin' iframe is allowed")
     15      var called = 0;
     16      function calledFromIframe() {
     17        called++;
     18      }
     19      function loaded() {
     20        assert_equals(document.getElementById('sandboxedframe').contentWindow.document.getElementById('inner').innerHTML, 'foo');
     21        assert_equals(called, 0);
     22        t.done();
     23      }
     24    </script>
     25 
     26    <iframe src="/html/browsers/sandboxing/inner-iframe.html" style="visibility:hidden;display:none" sandbox="allow-same-origin" id="sandboxedframe" onload="loaded();"></iframe>
     27 
     28    <div id="log"></div>
     29  </body>
     30 </html>