Problem/Motivation
The current Tippy implementation requires 'unsafe-inline' to be set for the style-src directive when using a content security policy.
Steps to reproduce
Add the following CSP header.
default-src 'self'; script-src 'self' https://unpkg.com; frame-ancestors 'self';
Open a page where Tippy is used, for example /admin/structure/webform/config and notice that the Tippy styles are no longer included. This issue happens regardless of using the CDN or a locally installed library.
Proposed resolution
Tippy provides a solution for this issue by loading the javascript and stylesheet separately, ensuring that the styles don't have to be injected.
Issue fork webform-3246508
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
jrockowitz commentedI think the answer is going to be to only support tippy 6.x and support CSP enabled.
Comment #3
jrockowitz commentedComment #5
paulocsComment #7
paulocsComment #8
jrockowitz commentedComment #9
jrockowitz commentedThis PR is looking pretty good. I still need to manually review it.
In Webform 6.2, we can change the tippy namespace from
tippyjs/6.x to justtippyjsComment #10
jrockowitz commentedThis ticket got a little off track because are just removing 5.x and not addressing the CSP support.
For now lets keep focusing on removing 5.x support.
Steps to review
Changes
Notes
Comment #11
jrockowitz commentedI posted Include /dist folder in release using GitHub build actions #1020, let's what happens.
Comment #12
jrockowitz commentedComment #13
jrockowitz commentedComment #14
jrockowitz commentedI created a new dedicated issues for #3255998: Enable CSP enabled support for Tippy.js
Comment #15
jrockowitz commentedComment #17
jrockowitz commentedComment #18
jrockowitz commented