'Blocked a frame with origin from accessing a cross-origin frame but its the exact same domain?

So I am trying to get this link from an iFrame which is hosted on my own site. They both have the same domain but somehow it still gives me this error message: Blocked a frame with origin ... from accessing a cross-origin frame. How is this possible and how can I fix this.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source