I have on a webpage an iframe element that loads my other website, and I'm trying to access the content of that webpage in an iframe. This works when both websites are on localhost, but on different domains I get this error : SecurityError: Failed to read the 'contentDocument' property from 'HTMLIFrameElement Blocked a frame with origin "http://site1.com" from accessing a frame with origin "http://site2.com". Protocols, domains, and ports must match.
I have control over both websites, I can disable headers or add new. Is there a technical way to enable first site reading the contents of the iframe ?