tor-browser

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

test_not-opener.html (2221B)


      1 <!DOCTYPE html>
      2 <html>
      3 <head>
      4    <script src="/tests/SimpleTest/SimpleTest.js"></script>
      5    <script src="/tests/SimpleTest/EventUtils.js"></script>
      6    <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
      7    <script type="text/javascript" src="NavigationUtils.js"></script>
      8    <style type="text/css">
      9      iframe { width: 90%; height: 50px; }
     10    </style>
     11 <script>
     12 if (!navigator.platform.startsWith("Win")) {
     13  SimpleTest.expectAssertions(0, 1);
     14 }
     15 
     16 window.onload = async function() {
     17  // navigateByLocation(window0);  // Don't have a handle to the window.
     18  navigateByOpen("window1");
     19  navigateByForm("window2");
     20  navigateByHyperlink("window3");
     21 
     22  await waitForFinishedFrames(6);
     23 
     24  is((await getFramesByName("window1")).length, 2, "Should not be able to navigate popup's popup by calling window.open.");
     25  is((await getFramesByName("window2")).length, 2, "Should not be able to navigate popup's popup by submitting form.");
     26  is((await getFramesByName("window3")).length, 2, "Should not be able to navigate popup's popup by targeted hyperlink.");
     27 
     28  // opener0.close();
     29  opener1.close();
     30  opener2.close();
     31  opener3.close();
     32 
     33  info("here")
     34  await cleanupWindows();
     35  info("there")
     36  SimpleTest.finish();
     37 };
     38 
     39 // opener0 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/open.html#window0", "_blank", "width=10,height=10");
     40 // eslint-disable-next-line @microsoft/sdl/no-insecure-url
     41 let opener1 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/open.html#window1", "_blank", "width=10,height=10");
     42 // eslint-disable-next-line @microsoft/sdl/no-insecure-url
     43 let opener2 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/open.html#window2", "_blank", "width=10,height=10");
     44 // eslint-disable-next-line @microsoft/sdl/no-insecure-url
     45 let opener3 = window.open("http://test1.example.org:80/tests/docshell/test/navigation/open.html#window3", "_blank", "width=10,height=10");
     46 </script>
     47 </head>
     48 <body>
     49 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=408052">Mozilla Bug 408052</a>
     50 <pre id="test">
     51 <script type="text/javascript">
     52 SimpleTest.waitForExplicitFinish();
     53 </script>
     54 </pre>
     55 </body>
     56 </html>