tor-browser

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

file_redirect.html (930B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <title>Bug1402363: Test mixed content redirects</title>
      5 </head>
      6 <body>
      7 
      8 <script type="text/javascript">
      9  const PATH = "https://example.com/tests/dom/security/test/mixedcontentblocker/";
     10 
     11  // check a fetch redirect from https to https (should be allowed)
     12  fetch(PATH + "file_redirect_handler.sjs?https-to-https-redirect", {
     13    method: 'get'
     14  }).then(function(response) {
     15    window.parent.postMessage("https-to-https-loaded", "*");
     16  }).catch(function(err) {
     17    window.parent.postMessage("https-to-https-blocked", "*");
     18  });
     19 
     20  // check a fetch redirect from https to http (should be blocked)
     21  fetch(PATH + "file_redirect_handler.sjs?https-to-http-redirect", {
     22    method: 'get'
     23  }).then(function(response) {
     24    window.parent.postMessage("https-to-http-loaded", "*");
     25  }).catch(function(err) {
     26    window.parent.postMessage("https-to-http-blocked", "*");
     27  });
     28 
     29 </script>
     30 </body>
     31 </html>