file_data_doc_ignore_meta_csp.html (646B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <title>Bug 1382869: data document should ignore meta csp</title> 5 <meta charset="utf-8"> 6 </head> 7 <body> 8 <script type="application/javascript"> 9 // 1) create a data document 10 const doc = document.implementation.createHTMLDocument(); 11 // 2) add meta csp to that document 12 const metaEl = doc.createElement('meta'); 13 metaEl.setAttribute('http-equiv', 'Content-Security-Policy'); 14 metaEl.setAttribute('content', "img-src 'none'"); 15 doc.head.appendChild(metaEl); 16 // 3) let the parent know we are done here 17 var result = "dataDocCreated"; 18 window.parent.postMessage({result}, "*"); 19 </script> 20 21 </body> 22 </html>