Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

225
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!