tor-browser

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

test_bloburl_location.html (909B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <meta charset="utf-8">
      5  <title>Test for blobURL in location</title>
      6  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      7  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
      8 </head>
      9 <body>
     10  <script type="application/javascript">
     11 
     12 var expectedData = null;
     13 onmessage = function(e) {
     14  if (expectedData === null) {
     15    expectedData = e.data;
     16  } else {
     17    is(e.data, expectedData, "Pathname should be not be changed");
     18    SimpleTest.finish();
     19  }
     20 };
     21 
     22 
     23 var ifr = document.createElement("iframe");
     24 document.body.appendChild(ifr);
     25 
     26 ifr.src = "data:text/html,<script>location=URL.createObjectURL(new%20Blob(['<script>parent.postMessage(location.pathname,\"*\");location.pathname=\"foo\";parent.postMessage(location.pathname,\"*\");<\/s' +'cript>'], {type:\"text/html\"}));<\/script>";
     27 
     28 SimpleTest.waitForExplicitFinish();
     29 
     30  </script>
     31 </body>
     32 </html>