Reputation: 17431
Do I have to use the "use script"
directive when serving my code with Content Security Policy enabled?
I cannot find any reference that says it is enforced but many code examples have it. I don't know if it's just best practice or required?
Upvotes: 0
Views: 86
Reputation: 944320
Do I have to use the "use script" directive when serving my code with Content Security Policy enabled?
No
I cannot find any reference that says it is enforced
Exactly
but many code examples have it. I don't know if it's just best practice or required?
"use strict"
is good practise entirely independent of the use (or otherwise) of CSP.
Upvotes: 1