Closed Omar-Ali closed 6 years ago
From: https://developers.facebook.com/docs/messenger-platform/discovery/customer-chat-plugin#debug-tips
If you see a console error like "Refused to display in a frame because an ancestor violates the following Content Security Policy directive: ", check that the domain of the page the plugin is being rendered on has been whitelisted. Also make sure you didn't set the Referrer-Policy header to no-referrer.
I'm still testing it on my localhost, I've already set the referrer policy to 'no-referrer' but I don't know how to whitelist my domain, nor my localhost.
@Omar-Ali You can use ngrok or localtunnel to get a domain when developing you webpage on localhost.
If you don't know how to whitelist your domain, you should check out - Prerequisite Section on README.
After whitelisting the domain on facebook and setting the Referrer-Policy header to no-referrer, I'm still getting the same error.
Maybe you can try to report on Facebook bug report or ask in Messenger Platform dev group
The problem just fixed a month later, I think it was something from Facebook end.
The issue here is that Facebook SDK has a white list, you can't white list localhost. You can work around it by using your hosts file to render localhost on your domain name, add a record into your hosts file something like:
127.0.0.1 www.mydomain.com
Then go to www.mydomain.com where this domain is white listed in facebook and it should work.
I'm trying to embed the component but the frame refuses to load and I'm facing this console error: