link-preload-report-only-nonce.sub.html (731B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>A Report-Only policy with a nonce does not send a report for an allowed link preload</title> 5 <script nonce="abc" src="/resources/testharness.js"></script> 6 <script nonce="abc" src="/resources/testharnessreport.js"></script> 7 <link nonce="abc" rel="preload" as="script" href="../support/pass.js"> 8 </head> 9 <body> 10 <script nonce="abc"> 11 var testName = "Report should not be sent for an allowed link preload"; 12 addEventListener("load", () => { 13 const script = document.createElement("script"); 14 script.nonce = "abc"; 15 script.src = `../support/checkReport.sub.js?reportExists=false&testName=${encodeURIComponent(testName)}`; 16 17 document.body.appendChild(script); 18 }); 19 </script> 20 </body> 21 </html>