【问题标题】:Facebook Customer Chat Plugin inside an iframeiframe 中的 Facebook 客户聊天插件
【发布时间】:2021-12-01 16:16:32
【问题描述】:

是否可以让客户聊天插件在 iframe 中工作?

添加content-security-policy: frame-ancestors IFRAME_DOMAIN 并显示Refused to frame 'https://www.facebook.com/' because an ancestor violates the following Content Security Policy directive: "frame-ancestors IFRAME_DOMAIN

【问题讨论】:

  • 如果您将两个域(托管 iframe 的域和嵌入 iframe 的域)都添加到白名单域中,它可能会(!)工作。

标签: javascript facebook iframe content-security-policy


【解决方案1】:

是的,FB 聊天插件旨在嵌入。

您只需要whitelist 允许聊天操作的域。这应该可以解决 Facebook 的 CSP 中的 frame-ancestors 问题。

也许你会 have to add intent:fb-messenger: 方案。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-06-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多