• Resolved brun3o

    (@brun3o)


    Hello! And thanks for providing such a great tool!

    I’m experiencing a problem with a Spotify playlist embed on my site, which is seemingly occurring from some sort of clash with the LiteSpeed Cache plugin.

    The iframe is embedded on a page of my site, and works well whenever cache is disabled in the LiteSpeed Cache plugin, as well as about 10 minutes after clearing the LiteSpeed cache when the caching feature is enabled. When cache is enabled, the console provides the website visitor with the following error:

    Refused to load https://open.spotify.com/embed/playlist/3PIuQwGcZBYpWY2dhXDjSa?utm_source=generator because it does not appear in the frame-src directive of the Content Security Policy.

    I’ve made sure that I’ve excluded cookies_and_content_security_policy in LiteSpeed Cache, and I’ve also added Spotify from quick start in the Cookies and Consent Security Policy. I have other embeds (e.g. Google Maps and YouTube) that work just fine

    Do you have any idea what might be causing this? Thanks for the help!

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Johan Jonk Stenstr?m

    (@jonkastonka)

    Hi! Can you send me a page where you embed Spotify and also activate debug in the Cookies and Content Security Policy, and I’ll take a look.

    Thread Starter brun3o

    (@brun3o)

    Done! The embed is on the bottom of the page here: https://storkyrkanskammarkor.se/konserter/in-paradisum/

    I just cleared the cache so it might take some time before the error appears.

    • This reply was modified 1 year ago by brun3o.
    Plugin Author Johan Jonk Stenstr?m

    (@jonkastonka)

    Looks like a caching problem. If I add a random querystring to the page like https://storkyrkanskammarkor.se/konserter/in-paradisum/?omg=bbq it works just fine.

    When just accepting the debug looks like this:

    <!-- Setting Content Security Policy --><!-- If you have saved your cookie settings and don't get a comment after this one saying that there is a cookie set your host is probably using cookie cache. Ask them to uncache cookies_and_content_security_policy. WP Engine is one of those hosts. --><!-- Cookie policy page ID is: 568 --><!-- Content Security Policy Cookie settings: script-src 'self' 'unsafe-inline' 'unsafe-eval' ;img-src 'self' data: ;object-src 'self' data: ;frame-src 'self' data: ; -->

    But, when adding that random querystring Spotify loads and the debug looks like it should:

    <!-- Setting Content Security Policy --> <!-- If you have saved your cookie settings and don't get a comment after this one saying that there is a cookie set your host is probably using cookie cache. Ask them to uncache cookies_and_content_security_policy. WP Engine is one of those hosts. --> <!-- We have Content Security Policy Cookie set --> <!-- We have a Content Security Policy Cookie settings saved --> <!-- Content Security Policy Cookie value: ["statistics","experience","markerting"] --> <!-- We have a json in the Content Security Policy Cookie --> <!-- We have statistics in the Content Security Policy Cookie --> <!-- We have experience in the Content Security Policy Cookie --> <!-- We have markerting in the Content Security Policy Cookie --> <!-- Cookie policy page ID is: 568 --> <!-- Content Security Policy Cookie settings: script-src 'self' 'unsafe-inline' 'unsafe-eval' https://maps.googleapis.com/ https://maps.google.com/ https://youtube.com/ https://*.youtube.com/; img-src 'self' data: https://maps.gstatic.com/ https://maps.google.com/ https://maps.googleapis.com/ https://*.ytimg.com/; object-src 'self' data: https://www.google.com/ https://maps.google.com/ https://youtube.com/ https://*.youtube.com/ https://youtube-nocookie.com/ https://*.youtube-nocookie.com/ https://youtu.be/ https://*.spotify.com/; frame-src 'self' data: https://www.google.com/ https://maps.google.com/ https://youtube.com/ https://*.youtube.com/ https://youtube-nocookie.com/ https://*.youtube-nocookie.com/ https://youtu.be/ https://*.spotify.com/; -->
    Thread Starter brun3o

    (@brun3o)

    When I took a closer look, almost all pages on the site had the wrong debug. After a while, even the page with the query string you provided.

    Apparently I was wrong about that disabling caching in LSCache solves the issue. It persists even when disabling the caching functionality of the plugin, although disabling the plugin altogether fixes it.

    Thread Starter brun3o

    (@brun3o)

    Here again with a final update. I found out in the end that my issue was caused by my LSCache page optimization settings for JS. Tweaking them solved it, and CCWP now works just fine together with LSCache! Thank you once again!

    Plugin Author Johan Jonk Stenstr?m

    (@jonkastonka)

    Sweet! Can you share the tweak so that I, and others, knows how to fix it?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Refused to load Spotify embed’ is closed to new replies.