tor-browser

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

blob-urls-match-blob.sub.html (1194B)


      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="script-src 'self' 'unsafe-inline' blob:; connect-src 'self';">
      7    <title>blob-urls-match-blob</title>
      8    <script src="/resources/testharness.js"></script>
      9    <script src="/resources/testharnessreport.js"></script>
     10    <script src='../support/logTest.sub.js?logs=["PASS (1/1)"]'></script>
     11    <script src="../support/alertAssert.sub.js?alerts=[]"></script>
     12 </head>
     13 
     14 <body>
     15    <p>
     16        blob: URLs are same-origin with the page in which they were created, but match only if the blob: scheme is specified.
     17    </p>
     18    <script>
     19        window.addEventListener('securitypolicyviolation', function(e) {
     20            log("FAIL");
     21        });
     22 
     23        function pass() {
     24            log("PASS (1/1)");
     25        }
     26        var b = new Blob(['pass();'], {
     27            type: 'application/javascript'
     28        });
     29        var script = document.createElement('script');
     30        script.src = URL.createObjectURL(b);
     31        document.body.appendChild(script);
     32 
     33    </script>
     34    <div id="log"></div>
     35 </body>
     36 
     37 </html>