fetch-csp-iframe.html (484B)
1 <script> 2 var meta = document.createElement('meta'); 3 meta.setAttribute('http-equiv', 'Content-Security-Policy'); 4 meta.setAttribute('content', decodeURIComponent(location.search.substring(1))); 5 document.head.appendChild(meta); 6 7 function load_image(url) { 8 return new Promise(function(resolve, reject) { 9 var img = document.createElement('img'); 10 document.body.appendChild(img); 11 img.onload = resolve; 12 img.onerror = reject; 13 img.src = url; 14 }); 15 } 16 </script>