Skip to content

Webpack compiled bundle includes Function() eval which chrome extensions does not allow #1531

@eyalw

Description

@eyalw

Hi,

my webpack build output a javascript that uses Funciton("") evaluating. Chrome extensions security policy does not allow that:

Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' blob: filesystem: chrome-extension-resource:".

Is there a way to use webpack without it outputting unsafe expressions like this?

e.g. Angular has a configuration to disable features that use unsafe eval:
https://docs.angularjs.org/api/ng/directive/ngCsp

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions