Advertisement
ScottHelme

CSP Style Issue

Jun 29th, 2020
444
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. content-security-policy: default-src 'none'; script-src 'self' 'unsafe-inline'; style-src 'self'; img-src 'self'
  2.  
  3. <html>
  4. <body>
  5. <script>
  6. const elSVG = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
  7. elSVG.style.background = 'green';
  8. document.body.appendChild(elSVG);
  9. const elDIV = document.createElement('div');
  10. elDIV.style.width = 100;
  11. elDIV.style.height = 100;
  12. elDIV.style.background = 'red';
  13. document.body.appendChild(elDIV);
  14. </script>
  15. </body>
  16. </html>
Advertisement
RAW Paste Data Copied
Advertisement