tor-browser

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

invalid-directive.html (774B)


      1 <meta http-equiv="content-security-policy" content="img-src 'none'; aaa;">
      2 <title>Parsing: Unknown directive is ignored</title>
      3 <script src="/resources/testharness.js"></script>
      4 <script src="/resources/testharnessreport.js"></script>
      5 <script>
      6  promise_test(async t => {
      7    img = document.createElement('img');
      8    img.src = "../support/fail.png";
      9    return Promise.all([
     10      new Promise((resolve, reject) => {
     11        img.onerror = resolve;
     12        img.onload = reject;
     13      }),
     14      new Promise(resolve => {
     15        window.addEventListener('securitypolicyviolation', e => {
     16          if (e.blockedURI.endsWith("/support/fail.png"))
     17            resolve();
     18        });
     19      })
     20    ]);
     21  }, "Even if an unknown directive is specified, img-src is honored.");
     22 </script>