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

147
Views
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

over 4 years ago · Santiago Trujillo
1 answers
Answer question

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

over 4 years ago · Santiago Trujillo 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!