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


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

  • 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

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"
        <policy id="frame-src">
                <value id="facebook-frame" type="host">*.facebook.com</value>

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.