Skip to content

"new Function" is incompatible with "safe" content-security-policy #300

@amfine-soft-drault

Description

@amfine-soft-drault

Any Content-Security-Policy that block 'unsafe-eval' will prevent the component from working properly

as much as i could tell, this is due to the use of new Function

i found 2 use cases :
https://github.com/leezng/vue-json-pretty/blame/dev/src/components/Tree/index.tsx#L242
https://github.com/leezng/vue-json-pretty/blob/dev/src/components/TreeNode/index.tsx#L251

any way to implement these bits in a "safer" way ?

thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions