Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
 - This WPT test may be referenced by the following Test IDs:
            
- /content-security-policy/inheritance/javascript-url-open-in-main-window.html - WPT Dashboard Interop Dashboard
 
 
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
  async_test(t => {
    window.addEventListener("message", t.step_func_done(e => {
      assert_equals(e.data, "img blocked",
                    "Img should be blocked by CSP img-src 'none'");
    }));
    w = window.open("./support/navigate-self-to-javascript.html");
    t.add_cleanup(w.close);
  }, "Executing Javascript URL keeps enforcing previous CSPs of the document.");
</script>