【问题标题】:Generic solution of 'X-Frame-Options' to 'SAMEORIGIN' issue'X-Frame-Options' 到 'SAMEORIGIN' 问题的通用解决方案
【发布时间】:2014-04-30 00:56:49
【问题描述】:

我正在尝试在 iframe 中打开 http://teeSpring.com/。它抛出Refused to display 'http://teespring.com/' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'. 错误。
我已经经历了多个答案,但没有一个对我有用。大多数解决方案都特定于 google-maps、facebook 或 youtube 视频。
这是我的代码:

<html>
    <head>
        <base target="_blank" />
        <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
    </head>
    <body>
        <iframe src="http://teespring.com" name="frame1" style="border: 0; width:20%; height:20%; overflow:auto;">

        </iframe>
    </body>
</html>

我确实使用了target="_blank",但没有运气。

注意:尝试打开第三方页面。所以我无法控制添加标题或其他元数据。

【问题讨论】:

  • 您使用哪种服务器端语言?
  • 暂时没有。现在我只有一个静态页面。

标签: html iframe x-frame-options


【解决方案1】:

teespring.com 告诉访问者的浏览器他们不应该在框架中显示它。

您有四个选择:

  • 与运行teespring.com 的人交谈并说服他们不要这样做
  • 只需链接到它们,而不是试图将它们塞入框架中
  • 根本不要将访问者指向他们
  • 代理他们的网站并将 iframe 指向您的代理(这可能会进入侵犯版权的领域)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-05-09
    • 1970-01-01
    • 2013-04-30
    • 2013-08-10
    • 2019-06-22
    • 2016-02-10
    • 1970-01-01
    • 2018-05-27
    相关资源
    最近更新 更多