Many thanks to the Chromium list contributor who pointed out that to create a Function
object in the way underscore is doing it requires the manifest.json
option for content_security_policy
to include 'unsafe-eval'.
As an example, your manifest.json
could be
{
"manifest_version": 2,
...
"content_security_policy": "script-src 'self' 'unsafe-eval'",
...
}
and then the underscore behavior would work because this policy allows it. For more information on the format see the Chrome documentation on this option here.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…