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

233
Vistas
HTML JS Open new window with console in google chrome

This is client-side HTML. I'm just using HTML for automation.

My initial goal was to open a new window https://live.ipms247.com/login/ and then paste the values in the three login fields. All three fields have ID tags. And I can write to them from the console. For example.

document.getElementById("username").value="sample"; 
document.getElementById("hotelcode").value="12345"; 
document.getElementById("password").value="Password";

I wrote a code to copy text from parent window to child window at the click of a button. My code is on a local file.

<html>
<head>
<script type="text/javascript">
function init()
{
    popupWin = window.open('https://live.ipms247.com/login/','popupWin','');
}
function transferText()
{
    popupText = popupWin.document.getElementById("username");
    parentText = document.getElementById("parentTextBox");
    popupText.value = parentText.value
}
</script>
</head>
<body>
<input type="text" id="parentTextBox" onkeyup="transferText();" value="Hello World">
<input type="button" onclick="init();" value="popup window">
<input type="button" onclick="transferText();" value="Transfer Text">
</body>
</html>

However, this does not work, apparently because my code is on a local file and the website is on another domain.

So my only solution to this problem, so far, is to launch the site with onlick and then focus to it. Press Ctrl+Shift+J to open the console and then paste the commands (I have code which copies them to clipboard) and hit enter.

Is there any possibility to launch the new window with the console open and focus on the console?

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

0

You can not do this because JavaScript restricts you to the user.

If you want to reach your goal, you can use the frames API

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