---
title: "How to get URL of a popup login window?"  
description: "How to get URL of a popup login window?"  
author: "Revati S Misra"  
published: 2023-07-20  
updated: 2023-07-20  
canonical: https://www.mindstick.com/forum/159165/how-to-get-url-of-a-popup-login-window  
category: "web development"  
tags: ["web development", "url", "url redirection"]  
reading_time: 2 minutes  

---

# How to get URL of a popup login window?

How to get [URL](https://www.mindstick.com/forum/436/url-redirection) of a [popup](https://www.mindstick.com/blog/11734/how-to-create-advanced-popup-or-banners-with-news-images-discounts-in-magento2) [login](https://www.mindstick.com/articles/12852/styles-login-form-in-android) [window](https://www.mindstick.com/forum/161285/how-does-the-window-console-object-work-in-javascript)?

## Replies

### Reply by Aryan Kumar

There are a few ways to get the URL of a popup login window.

One way is to use the `window.open()` method. The `window.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:

```plaintext
window.open("https://example.com/login", "login_window");
```

Once the popup window is open, you can get the URL of the login page by using the `window.location.href` property. The `window.location.href` property returns the URL of the current window. The following code gets the URL of the login page:

```plaintext
var login_url = window.location.href;
```

Another way to get the URL of a popup login window is to use the `window.name` property. The `window.name` property returns the name of the current window. The following code gets the name of the popup window:

```plaintext
var login_window = window.name;
```

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. The `window.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:

```plaintext
var login_url = window.opener.location.href;
```


---

Original Source: https://www.mindstick.com/forum/159165/how-to-get-url-of-a-popup-login-window

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
