test_xslt_inherits_csp.html (1051B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>Bug 1597645: Make sure XSLT inherits the CSP r=ckerschb</title> 6 <!-- Including SimpleTest.js so we can use waitForExplicitFinish !--> 7 <script src="/tests/SimpleTest/SimpleTest.js"></script> 8 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> 9 </head> 10 <body> 11 <body> 12 <iframe src="file_xslt_inherits_csp.xml"></iframe> 13 14 <script class="testbody"> 15 SimpleTest.requestCompleteLog(); 16 SimpleTest.waitForExplicitFinish(); 17 18 let frame = document.querySelector("iframe"); 19 20 window.addEventListener("load",()=>{ 21 let link = frame.contentWindow.document.querySelector("a"); 22 link.click(); // 23 24 requestAnimationFrame(()=>{ 25 // Wait one Frame to let the browser catch up 26 // before checking the dom. 27 let res = !frame.contentWindow.document.body.innerText.includes("JS DID EXCECUTE"); 28 ok(res, "The CSP did block injected JS "); 29 SimpleTest.finish(); 30 }); 31 }) 32 </script> 33 </html>