material icon indicating copy to clipboard operation
material copied to clipboard

Inline <style> elements violates style-src Content Security Policy

Open jelbourn opened this issue 10 years ago • 5 comments

See https://developer.mozilla.org/en-US/docs/Web/Security/CSP/CSP_policy_directives#style-src

In order to address this, there would need to be build-time tooling to let people generate their own theme css outputs.

jelbourn avatar Jan 08 '16 21:01 jelbourn

Would be nice if there was also a gulp plugin for this

epelc avatar Jan 10 '16 01:01 epelc

@Emeegeemee fixed the <style> element issue in #6691, but there are still inline style attributes that are potentially a problem in: slider, tabs, and two in util.js here and here

jelbourn avatar Jan 15 '16 19:01 jelbourn

I found a few more violations with using *.setAttribute('style', *) in MenuBarController and util.js.

Emeegeemee avatar Jan 16 '16 22:01 Emeegeemee

I believe I've fixed all the unsafe-inline violations in this commit, but will do another check and update any tests before sending a pull request next week.

In case anyone wants to test out the doc site with CSP enabled, I created this commit for reference.

Emeegeemee avatar Jan 17 '16 01:01 Emeegeemee

This should now be resolved by the two commits from @Emeegeemee

jelbourn avatar Jan 20 '16 17:01 jelbourn