Skip to content

Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed #491

@guilala

Description

@guilala

Security wise it's preferable to have Content-Security-Policy 'self' for script sources. But using regl with that policy, runs into this error:

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'".

This happens in regl's function 'compile', at 'var proc = Function.apply(null, linkedNames.concat(src));'.

After adding 'unsafe-eval' to script source policy, regl runs just fine. But that's arguably a major drawback for using regl.

Is there really no way of avoiding methods similar to eval for parsing regl strings?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions