Мне нужно добавить плагин Facebook Messanger на простую HTML-страницу или проект MVC, но когда я публикую этот скрипт на моем сайте, он выдает следующее исключение:
Unchecked runtime.lastError: The message port closed before a response was received. staticxx.facebook.com/connect/xd_arbiter.php?version=44#channel=fe3f52ddd4adec&origin=https%3A%2F%2Flocalhost%3A44340:1 Unchecked runtime.lastError: The message port closed before a response was received. about:blank:1 Refused to display 'https://www.facebook.com/v4.0/plugins/customerchat.php?app_id=&attribution=setup_tool&channel=https%3A%2F%2Fstaticxx.facebook.com%2Fconnect%2Fxd_arbiter.php%3Fversion%3D44%23cb%3Df313f2f12ec5174%26domain%3Dlocalhost%26origin%3Dhttps%253A%252F%252Flocalhost%253A44340%252Ffe3f52ddd4adec%26relation%3Dparent.parent&container_width=0&locale=en_US&page_id=1830999227144000&sdk=joey&theme_color=%230084ff' in a frame because an ancestor violates the following Content Security Policy directive: "frame-ancestors https://www.facebook.com". about:blank:1 Refused to display 'https://www.facebook.com/v4.0/plugins/customerchat.php?app_id=&attribution=setup_tool&channel=https%3A%2F%2Fstaticxx.facebook.com%2Fconnect%2Fxd_arbiter.php%3Fversion%3D44%23cb%3Df313f2f12ec5174%26domain%3Dlocalhost%26origin%3Dhttps%253A%252F%252Flocalhost%253A44340%252Ffe3f52ddd4adec%26relation%3Dparent.parent&container_width=0&locale=en_US&page_id=1830999227144000&sdk=joey&theme_color=%230084ff' in a frame because an ancestor violates the following Content Security Policy directive: "frame-ancestors https://www.facebook.com".
вот мой скрипт -
<!-- Load Facebook SDK for JavaScript --> <div id="fb-root"></div> <script> window.fbAsyncInit = function() { FB.init({ xfbml : true, version : 'v4.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="******" theme_color="#0084ff"> </div>