mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-15 10:09:45 +00:00
Enabled unsafe eval
This commit is contained in:
@@ -35,7 +35,9 @@ function addCspAsMetaTag(htmlString: string) {
|
||||
// Hash inline scripts from this html file, if there are any
|
||||
const scriptHashes = s.hashAllInlineScripts();
|
||||
// Generate a strict CSP as a string
|
||||
const strictCsp = StrictCsp.getStrictCsp(scriptHashes, false, true);
|
||||
// enableTrustedTypes: false, enableBrowserFallbacks: true
|
||||
// enableUnsafeEval: true, to accomodate for uses of eval by emscripten. Enabling eval makes the CSP a bit less secure
|
||||
const strictCsp = StrictCsp.getStrictCsp(scriptHashes, false, true, true);
|
||||
// Set this CSP via a meta tag
|
||||
s.addMetaTag(strictCsp);
|
||||
const htmlStringWithCsp = s.serializeDom();
|
||||
|
||||
Reference in New Issue
Block a user