Currently delving into the Chrome extension document titled "Content Security Policy (CSP)", and I came across an interesting piece of information:
The documentation mentions that inline JavaScript, as well as risky string-to-JavaScript techniques like eval, are prohibited from executing. This rule extends to both inline blocks and inline event handlers (such as
<button onclick="...">
)....
Furthermore, there isn't a way to relax this restriction against running inline JavaScript. Even setting a script policy that includes unsafe-inline will not have any impact, as it is intentionally implemented this way.
Could someone shed light on why inline <script>
blocks are deemed unsafe? Examples would be greatly appreciated if possible.
Many thanks in advance!