javascript_src_allowed-window_location.html (870B)
1 <!DOCTYPE HTML> 2 <html> 3 4 <head> 5 <!-- 6 'sha256-IIiAJ8UuliU8o1qAv6CV4P3R8DeTf/v3MrsCwXW171Y=' ==> 'javascript:opener.postMessage('pass', '*')' 7 --> 8 <script src='/resources/testharness.js' nonce='abc'></script> 9 <script src='/resources/testharnessreport.js' nonce='abc'></script> 10 </head> 11 12 <body> 13 <div id='log'></div> 14 <script nonce='abc'> 15 var t1 = async_test("Test that the javascript: src is allowed to run"); 16 17 window.onmessage = t1.step_func_done(function(e) { 18 assert_equals(e.data, "pass"); 19 }); 20 21 window.open('support/child_window_location_navigate.sub.html' + 22 '?csp=' + encodeURI("script-src 'unsafe-hashes' 'nonce-abc' 'sha256-IIiAJ8UuliU8o1qAv6CV4P3R8DeTf/v3MrsCwXW171Y='") + 23 '&url=' + encodeURI("javascript:opener.postMessage('pass', '*')")); 24 </script> 25 </body> 26 27 </html>