html - 您可以使用 iframe 从您的页面导航其他网站吗?

标签 html css

我正在尝试制作一个网页,从中我可以通过 iframe 浏览我的社交媒体提要、电子邮件收件箱和新闻来源。这是可能吗?我注意到 youtube 和 facebook 不允许在 iframe 中显示他们的网站。有没有其他方法可以使这项工作正常进行?

感谢您花时间阅读。

最佳答案

如果一个简单的方法不起作用,那么在 Javascript 中也没有任何方法可以做到这一点。 iframe 不工作的最可能原因是因为目标站点正在发送 header 以防止其他站点对其进行 iframing:

X-Frame-Options: DENY

许多网站都会这样做,以防止称为 UI Redressing 或 Click Hijacking 的常见漏洞。一些站点还将包含一些帧破坏 Javascript 作为 HTTP header 的备份安全措施。

The X-Frame-Options HTTP response header can be used to indicate whether or not a browser should be allowed to render a page in a or . Sites can use this to avoid clickjacking attacks, by ensuring that their content is not embedded into other sites.

关于html - 您可以使用 iframe 从您的页面导航其他网站吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54554976/

相关文章:

php - WordPress:尝试使用 "get_categories()"获取特定类别 url

jquery - onscroll函数,如果 child 有一个类(class),那么也为 parent 添加一个类(class)

html - 我的网页结束了,但滚动还在继续

html - 在移动版本中居中图像

javascript - slideToggle() 问题

javascript - 我可以用类将图像添加到 div 中吗?

javascript - cordova 应用程序中全屏模式下的纵向 HTML5 视频在 Android 设备上被拉伸(stretch)

javascript - 如何在网站上制作弧形动画 - CSS 或 JavaScript?

html - CSS2版高度: calc(100% - 18px)

javascript - 如何写入 iframe 内的文本框