tor-browser

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

sandbox_029.htm (1290B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4    <title>HTML5 Sandbox: Block document.cookie inside iframe with the sandbox attribute.</title>
      5    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
      6    <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
      7    <link rel="help" href="http://dev.w3.org/html5/spec/Overview.html#sandboxed-origin-browsing-context-flag" />
      8    <meta name="assert" content="Block document.cookie inside iframe with the sandbox attribute." />
      9    <script src="/resources/testharness.js"></script>
     10    <script src="/resources/testharnessreport.js"></script>
     11 </head>
     12 <body>
     13    <script type="text/javascript">
     14 
     15        var t = async_test("Block document.cookie inside iframe with the sandbox attribute.");
     16 
     17        function callback(event)
     18        {
     19            t.step(function(){
     20                assert_true('sandbox' in document.createElement('iframe'));
     21                assert_equals(event.data, "cookies are not R/W");
     22            });
     23            t.done();
     24        }
     25 
     26        var timer = setTimeout(callback, 4000);
     27        window.addEventListener("message", callback, false);
     28    </script>
     29    <div id=log></div>
     30        <iframe src="support/iframe_sandbox_029.htm" sandbox="allow-scripts" style="display:none"></iframe>
     31 </body>
     32 </html>