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

Avoid more CSP violations errors #775

Open
Siltaar opened this issue Apr 25, 2024 · 3 comments
Open

Avoid more CSP violations errors #775

Siltaar opened this issue Apr 25, 2024 · 3 comments

Comments

@Siltaar
Copy link

Siltaar commented Apr 25, 2024

Hi,

I'm using ListJS v2.3.5 from @lovasoa in the Meta-Press.es WebExtension, with strict CSP rules "default-src 'self'".

ListJS generates a lot of CSP violation error messages while I'm just displaying 20 items in one list, and 1 item in another.

 Content-Security-Policy: The page’s settings blocked an inline style (style-src-attr) from being applied because it violates the following directive: “default-src 'self'”

24622 occurrences at list.min.js:1:12740

I also get 490 occurrences from list.min.js:1:12027

Would it be possible to have the styles in a separate file ? (considering it would avoid further CSP violation error messages).

@lovasoa
Copy link

lovasoa commented Apr 25, 2024

Hello! I'm not interested in implementing that myself, but if you want, you can make a pull request and I'll review it.

It shouldn't make distribution harder, so it would be nice if the css was still bundled in the package by default, just with an option to serve it separately.

Maybe create list-nostyles.js, styles.css, and a generated list.js that contains both and applies the stylesheet on load by default.

@Siltaar
Copy link
Author

Siltaar commented Apr 25, 2024

Thanks for your quick reply.
I note this task for further investigation and might handle it later (in months or years).
I wonder if those error messages are implying a performance penalty…

@Siltaar
Copy link
Author

Siltaar commented Apr 27, 2024

I tried a simple approach here : sqlpage#3

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

2 participants