Get current popup url using javascript

I had a webpage with a link that opens a new page in a popup window. Everything is in order to date. A pop-up window contains a credit card payment page owned by a third-party server. After the payment stream is completed, a response is displayed and there is a change in the URL.

I need to get this url.

Is this possible in javascript?

+7
source share
2 answers

The page URL is accessible through the location property of the window object. If you visit the site in the same subdomain as you, you can get the address through

popupWindow.location.href 

However, if the popup is third-party, the same origin policy applies and you are not allowed to check the location. pop-up window. The only ways to get around the same origin policy is through third-party collaboration.

+15
source

Google is your friend; D

  var newURL = window.location.protocol + "://" + window.location.host + "/" + window.location.pathname; 
0
source

All Articles