我正在尝试在仅包含 iframe 的简单 HTML 页面中显示 Facebook 页面。
这是我的 HTML 代码:
<html>
<body>
<iframe src="http://www.facebook.com"></iframe>
</body>
</html>
我总是在 Google Chrome 的控制台中收到此错误:
拒绝在框架中显示“ http://www.facebook.com/ ”,因为它将“X-Frame-Options”设置为“DENY”。
顺便说一句,我对这些 iframe 也有这个问题:
<iframe src="https://mail.google.com/mail/mu/mp/any"></iframe>
<iframe src="http://m.facebook.com"></iframe>
<iframe src="http://m.youtube.com"></iframe>
<iframe src="http://m.dropbox.com"></iframe>
<iframe src="http://m.yahoo.com"></iframe>
<iframe src="http://www.google.com"></iframe>
<iframe src="http://mail.google.com"></iframe>
<iframe src="http://www.facebook.com"></iframe>
<iframe src="http://www.youtube.com"></iframe>
<iframe src="http://www.dropbox.com"></iframe>
<iframe src="http://www.yahoo.com"></iframe>
同时,这个 iframe 运行良好!
<iframe src="http://www.google.com/custom"></iframe>
如何解决这个问题?
根据评论进行编辑:
如果无法解决,是否有使用 iframe 的替代方法?类似browser
标签的东西XUL
?我已经在 Firefox 扩展中尝试过浏览器标签并且效果很好,但是我现在正在编写一个 chrome 扩展,所以我不能再依赖 XUL 了吗?