I need to press button from my iframe on my parent window, but the parent window is in another domain AND I have no control over the code of that window. Is there a way to do it? Jsonp? cors? All solutions for that kind of problems involving having control over the parent window code. Maybe there is some way - I only need to press the button. Please post a small code example if possible.I can't modify code of parent window and can't add listener for post messaging for example. I have to access dom from my ifarme and press the button without any code change on parent window
No, this is impossible.
You cannot take action on the DOM of the parent of an iframe from the iframe when the parent is of another domain unless you have control of the parent domain. Even if you had control of the parent domain, your capabilities would still be restricted.
If this were possible, sites that use ads, show videos, etc would all be very insecure due to the iframe used for said content being able to read and interact with the parent page.