3
votes

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.

2
you need to accept an answer. - oligofren

2 Answers

8
votes

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

-1
votes

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