I’ve making a widget and I need to redirect a parent window to certain url, after specific event in popup, whitch base on another domain. How a can do this.
window.opener.location.replace(url);
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You just cannot do that. Cross-site scripting is not allowed in most browsers.
You can, however, communicate with the other window via cross-document messaging described here: https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
The most you can to is to send a message from the popup to the opener and listen for such message in the opener. The opener then has to change its location on its own.