How to get URL of a popup login window?
How to get URL of a popup login window?
154
20-Jul-2023
Updated on 20-Jul-2023
Aryan Kumar
20-Jul-2023There are a few ways to get the URL of a popup login window.
One way is to use the
window.open()
method. Thewindow.open()
method takes two arguments: the URL of the window to open, and a name for the window. The following code opens a new popup window with the URL of the login page:Once the popup window is open, you can get the URL of the login page by using the
window.location.href
property. Thewindow.location.href
property returns the URL of the current window. The following code gets the URL of the login page:Another way to get the URL of a popup login window is to use the
window.name
property. Thewindow.name
property returns the name of the current window. The following code gets the name of the popup window:Once you have the name of the popup window, you can get the URL of the login page by using the
window.opener.location.href
property. Thewindow.opener.location.href
property returns the URL of the window that opened the current window. The following code gets the URL of the login page: