I'm having trouble with the facebook Chat plugin, it was working on my website in safari, but seems to have stopped working. This is in iOS and Mac OS. It works fine in Chrome. I copied the code from the Advanced Messenger settings...
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
xfbml : true,
version : 'v5.0'
});
};
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = 'https://connect.facebook.net/en_US/sdk/xfbml.customerchat.js';
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<!-- Your customer chat code -->
<div class="fb-customerchat"
attribution=setup_tool
page_id="xxxxxxxx">
</div>
I've ensured the domain is whitelisted.
I have created a content-security-policy for my site in the .htaccess file, but it still doesn't work. In safari, Edge or firefox, but works in Chrome:
<FilesMatch "\.(html|php)$">
Header set Content-Security-Policy "
default-src 'self' *.googleapis.com *.facebook.com *.marchex.io;
script-src 'self' *.cloudflare.com *.facebook.com *.marchex.io;
font-src 'self' *.googleapis.com *.gstatic.com;
img-src 'self' *.marchex.io data:;
frame-ancestors 'self' *.facebook.com;
child-src 'self' *.facebook.com;"
</FilesMatch>
The Policy does work. If I just set default-src 'self' it stops a lot of content loading.
Any help greatly appreciated