Search code examples
javascriptcross-domainsame-origin-policy

postMessage to change input content of iframe


I have an iframe with different source origin, is there a way to use postMessage to change value of an input inside this same iframe knowing that i have any control on it's source.?

I tried to inject a script that listen for the postMessage inside the iframe, but I am always blocked by origin policy.

Hope I am clear, please any help or clarification, I tried several tricks but witout any results.

Thank you.


Solution

  • The short answer is no, the security is place to stop you hacking someone else page.

    Their is a longer answer involving proxy servers, but then you are properly breaking a few of your countries laws around copyright and computer miss use.