Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inline styles are not compatible with CSP #49

Open
rassie opened this issue Jun 7, 2021 · 0 comments
Open

Inline styles are not compatible with CSP #49

rassie opened this issue Jun 7, 2021 · 0 comments

Comments

@rassie
Copy link

rassie commented Jun 7, 2021

Describe the bug
With CSP (Content Security Policy) enabled, inline styles are blocked, which leads to progress bars not working. Incompatibility with CSP is bad in general and worse in environments like Electron, which strongly recommend enabling CSP. While it's possible to enable unsafe-inline as a workaround, this is strongly discouraged.

To Reproduce

  1. Add CSP headers to a project with awesome-notifications
  2. Observe warnings and errors in the browser console

Expected behavior
No CSP errors or warnings should be displayed.

Additional context
This problem can apparently be solved by changing styles dynamically instead of generating those inside an HTML element. See https://stackoverflow.com/a/57633457/6460 for details and an example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant