1

Here is what is happening...

My website redirects to Third Party Website which uses window.location to redirect back to my website. All this is happenining inside a pop up window.

The issue i am facing is in Chrome, after the redirect window.close is undefined along with some other attributes like window.opener Any idea how can I close this window ?

Don't have much control over how redirection is happening as its a third party website.

I changed window.location in one of my pages to redirect to another page and in that page this issue was reproducible.

EDIT:

The issue was not window.location redirection but something else ... Trying to debug it further, have found a solution though and answered in this question.

Rishabh
  • 1,185
  • 1
  • 12
  • 28

2 Answers2

1

Once the open window navigates to a domain that is not the same as the parent, you no longer have access to the window from the parent.

To workaround this you can have a page on your site that just contains an iframe with the src attribute set to the appropriate 3rd party website url.

Rich O'Kelly
  • 41,274
  • 9
  • 83
  • 114
1

The first answer in this question worked: Issue with window.close and chrome

window.open('','_self', '');
window.close();

This works... the only reasong that i can think of is, on calling window.open window object is reinitialized in the pop up and hence window.close() does not return undefined.

Community
  • 1
  • 1
Rishabh
  • 1,185
  • 1
  • 12
  • 28