Skip to content

Refused to apply inline style because it violates the following Content Security Policy directive  #191

Open
@LoFenk

Description

@LoFenk

I'm (perhaps unwittingly) using some pretty restrictive CSP settings, requiring a nonce for inline scripts and styles. I'm getting three errors related to this:

Refused to apply inline style because it violates the following Content Security Policy directive: "style-src <edited out> Either the 'unsafe-inline' keyword, a hash (<edited out>), or a nonce ('nonce-...') is required to enable inline execution.

Two errors like this for style and one for script.

I went ahead and played in the code of the package, locally and added:
nonce={{ CSP_NONCE }}
in report.html at line 6 and 64, within the script and style tags respectively and it resolved 2 out of the 3 errors. I'm not sure where the 3rd error is coming from but it might be from the inline styles elsewhere.

Is there a more elegant way around that?

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