csp-error.https.sub.html (485B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <title>Notify parent on load and generate a CSP error</title> 5 </head> 6 <body> 7 <script> 8 addEventListener('load', () => { 9 // Alert the parent frame that this frame has loaded. 10 parent.postMessage('Loaded','*'); 11 12 // Trigger a CSP error, which should generate a report. 13 const img = document.createElement('img'); 14 img.src = "/reporting/resources/fail.png"; 15 document.body.appendChild(img); 16 }); 17 </script> 18 </body> 19 </html>