iFrame blocked due to portocols, domains & ports must match

匿名 (未验证) 提交于 2019-12-03 02:31:01

问题:

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.

回答1:

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



回答2:

Protocols, domains, and ports must match

<my host ip> is not the same as <target host ip> These are both parts of the domain in the url.

http:// is the Protocol
ip or website name is the domain
:xxxx is the port

so end result: http://ip:xxxx



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!