report-uri-from-child-frame.html (828B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <title>Reporting works in child iframes.</title> 7 <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'nonce-abc'"> 8 </head> 9 <body> 10 <script nonce="abc"> 11 window.onmessage = function(e) { 12 if (e.data == 'cookie set') { 13 var s = document.createElement('script'); 14 s.async = true; 15 s.defer = true; 16 s.src = '../support/checkReport.sub.js?reportField=violated-directive&reportValue=script-src%20%27self%27%20%27nonce-abc%27&reportCookieName=generate-csp-report'; 17 document.body.appendChild(s); 18 } 19 } 20 </script> 21 <iframe src="support/generate-csp-report.html"></iframe> 22 </body> 23 </html>