tor-browser

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

reporting-api-report-to-overrides-report-uri-1.https.sub.html (1098B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <title>Test that report-to overrides report-uri. This tests report-uri before report-to in the policy</title>
      5  <script src='/resources/testharness.js'></script>
      6  <script src='/resources/testharnessreport.js'></script>
      7 </head>
      8 <body>
      9  <script>
     10    var t1 = async_test("Test that image does not load");
     11    async_test(function(t2) {
     12    window.addEventListener("securitypolicyviolation", t2.step_func(function(e) {
     13        assert_equals(e.blockedURI, "{{location[scheme]}}://{{location[host]}}/content-security-policy/support/fail.png");
     14        assert_equals(e.violatedDirective, "img-src");
     15        t2.done();
     16      }));
     17    }, "Event is fired");
     18  </script>
     19  <img src='/content-security-policy/support/fail.png'
     20       onload='t1.unreached_func("The image should not have loaded");'
     21       onerror='t1.done();'>
     22  <!-- report-to overrides the report-uri so the report goes to a different endpoint and we should not have any reports sent to this endpoint -->
     23  <script async defer src='../support/checkReport.sub.js?reportExists=false'></script>
     24 </body>
     25 </html>