Refused to display… frame-ancestors https://www.facebook.com

前端 未结 10 1089
一个人的身影
一个人的身影 2020-12-28 12:45

I have included Facebook customer chat plugin on my website. It works fine for the first day. From the second day, it\'s not working. I have seen an error message in Google

相关标签:
10条回答
  • 2020-12-28 13:26

    Some of the common things

    • whitelist the domain name
    • Facebook page is publicly visible
    • correct page id
    • referrer policy is not set to "no-referrer"

      some other reasons,

    • page not loading through https
    • multiple facebook sdk are added

    source, more info

    0 讨论(0)
  • 2020-12-28 13:29

    Make sure your FB page is published.

    0 讨论(0)
  • 2020-12-28 13:29

    I think that's not coming from facebook but your website. Your browser refuses to display an iframe from a "bad" source, in this case facebook.com.

    You may read

    • https://developer.mozilla.org/en-US/docs/Web/Security/CSP
    • https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy

    Or greenlight any requests from facebook like in this example (which is not the best way to do it, as it undercuts some major protection against XSS):

    Link at Stackoverflow: Content-Security-Policy issue

    0 讨论(0)
  • 2020-12-28 13:30

    There are two things required to avoid this message:

    1. Ensure you have the correct Facebook page ID set in your HTML. This should be the numeric ID, not what you see in the URL. I found my page's numeric ID via https://findmyfbid.com

      Example:

      <div class="fb-customerchat" page_id="6708927376315932">
      </div>
      
    2. Whitelist your domain at Your Page > Settings > Messenger Platform. Ensure this matches your domain, uses HTTPS protocol, and include the port too if using a non-standard port. (And then make sure you hit the Save button!)

    0 讨论(0)
提交回复
热议问题