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

MediaElement does not work with CSP without 'unsafe-inline' specified for style-src #2729

Open
yippibrian opened this issue Feb 6, 2020 · 0 comments

Comments

@yippibrian
Copy link

If I set up my "Content-Security-Policy" (CSP) header as follows (using Apache .htaccess format) then MediaElementJS works fine.

Header always set Content-Security-Policy "default-src 'self'; style-src 'self' 'unsafe-inline'"

If I remove the 'unsafe-inline' from the end of the above line, then the play/pause button and the volume button on the player disappear as shown in the following image. This indicates that some stylesheets used by MediaElementJS has inline <script> elements, javascript: URLs, inline event handlers, or inline <style> elements.

It would be better security if MediaElementJS worked with the more strict CSP setting where you do not specify 'unsafe-inline' and it should be possible to rework the code to support this.

Here is some information about CSP for reference: https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP

ME-error

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