Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

122
Vistas
window.open to read the url of popup
<!DOCTYPE html>
<html>
<body>

<h1>The Window Object</h1>
<h2>The open() and close() Methods</h2>

<button onclick="openWin()">Open "myWindow"</button>
<button onclick="closeWin()">Close "myWindow"</button>

<script>
let myWindow;

function openWin() {
  myWindow = window.open("https://google.com", "", "width=2600,height=500");
  gg = myWindow.location.origin
  alert(gg)
}

function closeWin() {
  myWindow.close();
}
</script>

</body>
</html>

im aware that because of security reasons browsers wont let you read other tabs

but there is something i wanna know if the parent can open the popup page and close the popup page that means the popup page is still can be accessed through parent page

but is there any slightest chance where the parent page can read url of the popup page

using javascript or any library ? if so how ? considering there is no content security headers present for that popup page

iframe is getting blocked because x-frame headers

all i wanted is to just grab the url

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You could access it with myWindow.location.href but only if both windows are on the same subdomain.

Otherwise it is impossible due to same origin policies. Your best option would be to store the url in a variable

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda