0

Can I call onclick of any element of opener window from child window running on different domains

I have a web page in

http://mydomain.com/app/main.html

it opens a page on an other domain

http://domain2.com/app3/addandsave.html

now on main.html page (opener) I want to click button from addandsave.html (child window) can i do it, I can't update pages in mydomain

1 Answer 1

1

Standard security restrictions in browsers prevent the accessing of the DOM of a page loaded from a different origin, so in general: No.

With the cooperation of the other site, you can pass messages using postMessage and respond to them using JS loaded by the other site.

With the cooperation of the user, you can write a browser extensions that isn't subject to the usual security restrictions.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.