mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-15 18:19:47 +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
|
// Hash inline scripts from this html file, if there are any
|
||||||
const scriptHashes = s.hashAllInlineScripts();
|
const scriptHashes = s.hashAllInlineScripts();
|
||||||
// Generate a strict CSP as a string
|
// 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
|
// Set this CSP via a meta tag
|
||||||
s.addMetaTag(strictCsp);
|
s.addMetaTag(strictCsp);
|
||||||
const htmlStringWithCsp = s.serializeDom();
|
const htmlStringWithCsp = s.serializeDom();
|
||||||
|
|||||||
Reference in New Issue
Block a user