I'm reading Chrome extension document "Content Security Policy (CSP)". It says:
Inline JavaScript, as well as dangerous string-to-JavaScript methods like eval, will not be executed. This restriction bans both inline blocks and inline event handlers (e.g.
<button onclick="...">
)....
There is no mechanism for relaxing the restriction against executing inline JavaScript. In particular, setting a script policy that includes unsafe-inline will have no effect. This is intentional.
Why are inline <script>
blocks unsafe? Can anyone explain it? It will be better if you can give examples.
Thank you.