tor-browser

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

worker-connect-src-allowed.sub.html (1019B)


      1 <!DOCTYPE html>
      2 <html>
      3 
      4 <head>
      5    <!-- Programmatically converted from a WebKit Reftest, please forgive resulting idiosyncracies.-->
      6    <meta http-equiv="Content-Security-Policy" content="connect-src 'self'; script-src 'self' 'unsafe-inline';">
      7    <title>worker-connect-src-allowed</title>
      8    <script src="/resources/testharness.js"></script>
      9    <script src="/resources/testharnessreport.js"></script>
     10    <script src='../support/logTest.sub.js?logs=["xhr allowed"]'></script>
     11    <script src='../support/alertAssert.sub.js?alerts=[]'></script>
     12 
     13 </head>
     14 
     15 <body>
     16    <script>
     17        window.addEventListener('securitypolicyviolation', function(e) {
     18            log('Fail');
     19        });
     20 
     21        try {
     22            var worker = new Worker('/content-security-policy/connect-src/support/worker-make-xhr.sub.js');
     23            worker.onmessage = function(event) {
     24                log(event.data);
     25            };
     26        } catch (e) {
     27            log(e);
     28        }
     29 
     30    </script>
     31    <div id="log"></div>
     32 </body>
     33 
     34 </html>