2

I have installed extension for integrate facebook messenger chat. but giving " Refused to frame 'https://www.facebook.com/' because an ancestor violates the following Content Security Policy directive: "frame-ancestors https://www.facebook.com" in console and also messenger live chat application not appear in front end. what should I do for get this work.

enter image description here

2 Answers 2

2

I'm guessing you updated to 2.3.5 version.

Just run this terminal command

php bin/magento module:disable Magento_Csp

More information here: https://maxchadwick.xyz/blog/magento-disable-csp

enter image description here

3
  • thank you Joao. no luck yet.! i'm using M2.3
    – Ravi
    Commented Jul 6, 2020 at 11:51
  • I think it has something to do with it, I-ve had the same issue with the Paypal frame and this solved it. Did you run the clean /flush cache commands? Just updated the answer with the print of the error I was getting, please check if its similar to yours ;)
    – Joao71
    Commented Jul 6, 2020 at 12:41
  • Question edited with snap shot
    – Ravi
    Commented Jul 6, 2020 at 16:19
0

You have to create a file etc/csp_whitelist.xml

<?xml version="1.0" encoding="UTF-8"?>
<csp_whitelist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Csp:etc/csp_whitelist.xsd">
    <policies>
        <policy id="frame-src">
            <values>
                <value id="facebook-frame" type="host">*.facebook.com</value>
            </values>
        </policy>
    <policies>
</csp_whitelist>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.