iFrame由于协议,域名和端口必须匹配 [英] iFrame blocked due to portocols, domains & ports must match

查看:250
本文介绍了iFrame由于协议,域名和端口必须匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


屏蔽了源自 https://< my host ip> 访问原始 https://< target host ip>
帧。协议,域名和
端口必须匹配。


如果您注意到两者都是'https'。但仍然发生错误。请帮助 - 我该如何避免这种情况。

解决方案

正如标题所示:

  domains&端口必须匹配

两个不同的ips,这意味着您有两个不同的域。

阅读有关同源策略



如果您同时控制这两个域,则需要查看 window.postMessage

I am getting the error below:

Blocked a frame with origin https://<my host ip> from accessing a frame with origin https://<target host ip>. Protocols, domains, and ports must match.

If you notice both are 'https'. But still the error occurs. Please help - how do I avoid this.

解决方案

As the title says:

 domains & ports must match

Two different ips, that means you have two different domains.

Read about the same origin policy

If you control both domains, you need to look into window.postMessage

这篇关于iFrame由于协议,域名和端口必须匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆