content/html/content/test/file_iframe_sandbox_h_if1.html

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 <!DOCTYPE HTML>
     2 <html>
     3 <head>
     4   <meta charset="utf-8">
     5   <title>Tests for Bug 766282</title>
     6   <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
     7   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     9 </head>
    10 <script type="text/javascript">
    11   function ok(result, desc) {
    12     window.parent.ok_wrapper(result, desc);
    13   }
    15   function doStuff() {
    16     // Try to open a new window via target="_blank", target="BC766282" and window.open().
    17     // The window we try to open closes itself once it opens.
    18     sendMouseEvent({type:'click'}, 'target_blank');
    19     sendMouseEvent({type:'click'}, 'target_BC766282');
    21     try {
    22       window.open("file_iframe_sandbox_open_window_pass.html");
    23     } catch(e) {
    24       ok(false, "Test 3: iframes sandboxed with allow-popups, should be able to open windows");
    25     }
    26   }
    27 </script>
    28 <body onLoad="doStuff()">
    29   I am sandboxed but with "allow-popups allow-scripts allow-same-origin"
    31   <a href="file_iframe_sandbox_open_window_pass.html" target="_blank" id="target_blank">open window</a>
    32   <a href="file_iframe_sandbox_open_window_pass.html?BC766282" target="BC766282" id="target_BC766282">open window</a>
    33 </body>
    34 </html>

mercurial