使用iframe< x-frame-options>访问网站。

发布于 2025-01-28 15:51:18 字数 565 浏览 4 评论 0原文

我需要让 https://web.whatsapp.com 通过iframe嵌入在我的网站中。我得到x-frame-options的错误。我使用Express Server,并尝试使用Helmet

app.use(
    helmet.frameguard({
        action: "sameorigin",
    })
)

似乎不起作用。与deny相同。我读到允许从中不再支持Chrome浏览器。是否有机会绕过或允许x-frame-options接受某些起源? (也许还有其他选择如何嵌入 https://web.whatsapp.com 到我的网站?) 。

I need to have https://web.whatsapp.com embedded in my website via iframe. I get the error of X-Frame-Options. I use express server and I tried to configure it with helmet:

app.use(
    helmet.frameguard({
        action: "sameorigin",
    })
)

Doesn't seem to work. Same with deny. I read that ALLOW-FROM is not supported in Chrome browser anymore. Is there any chance to bypass or allow X-Frame-Options to accept certain origins? (Maybe there is any other options how to embed https://web.whatsapp.com to my website?).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

独自唱情﹋歌 2025-02-04 15:51:19

X框架选项可防止一个站点被构造。由于web.whatsapp.com阻止了框架,除非您代理连接并删除标题,否则您无能为力。将标题添加到网站框架中,另一个不会改变任何东西。

X-Frame-Options prevents a site from being framed. As web.whatsapp.com prevents framing, there is nothing you can do to allow it being framed, unless you proxy the connection and remove headers. Adding headers to the site framing the other won't change anything.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文