I have to use an inline event handler in the chrome extension that is written by Javascript. for example I want to have an onclick function for a button and I don't want to use addEventListener which is answered in the onclick or inline script isn't working in extension.
instead, I want to use the correct content_security_policy in the manifest.json. but I don't know how exactly to add SHA-256.
could you please help me to know what is CSP exactly and How can I add this in the manifest.json?
Asked
Active
Viewed 95 times
0
Hanie Asemi
- 1,148
- 2
- 8
- 19
-
1That topic you've linked already shows how to write CSP in a ManifestV2 extension. In MV3 you can't do it by design and there's no solution other than using a separate js file with addEventListener or assigning to `onclick` property in JS. – wOxxOm Jul 18 '21 at 14:37