Skip to content

Call new Function() which requires unsafe-eval in CSP rules #76

@robbie-c

Description

@robbie-c

If you search through the dist/main.js file, you'll find new Function("return this")

See https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-Policy/script-src#unsafe_eval_expressions for more about CSP. TLDR, it's blocked by anyone using CSP rules unless they include unsafe-eval

Additionally, it may trigger some warnings in the browser console and a report if they are using a tool like PostHog to track CSP violations.

I don't think your source code uses new Function("return this") at all, it's probably just how things are bundled.

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