tor-browser

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

test_base_csp_img.html (848B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <title>Base with base-uri CSP</title>
      5  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      6  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
      7 
      8  <!-- Set CSP -->
      9  <meta http-equiv="Content-Security-Policy" content="base-uri 'self';">
     10 
     11  <!-- Base should be ignored -->
     12  <base href="http://example.org/">
     13 </head>
     14 <body>
     15 
     16 <img src="/tests/parser/htmlparser/tests/mochitest/file_base_csp_img.sjs?image" width=10 height=10>
     17 
     18 <script>
     19 add_task(async function() {
     20  let response = await fetch(
     21    "http://mochi.test:8888/tests/parser/htmlparser/tests/mochitest/file_base_csp_img.sjs?result"
     22  );
     23  let hosts = await response.json();
     24 
     25  is(hosts.length, 1, "One host");
     26  is(hosts[0], "mochi.test", "Host was not influenced by base");
     27 
     28  info("finished");
     29 });
     30 </script>
     31 
     32 </body>
     33 </html>