How to get access from cross-site popup to window.opener?

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.

// popup:
window.opener.postMessage('replace your location', '*');

// opener:
window.onmessage = function (e) {
  if (e.data === 'replace your location') {
    window.location.replace(...);
  }
};

Tags:

Javascript