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

131
Views
Javascript window.confirm doesn't work if focus isn't on tab?

My code is extremely simple:

const response = confirm("Message");
console.log('done');

Edit: it turns out it has nothing to do with dev tools - it's whether my focus is on that tab or on a different one.


If I have the dev tools closed, the confirm modal simply does not appear and it skips straight to printing done. I have the dev tools open, the confirm modal appears.

I am kinda lost on this one, am I missing something here? If I just write setTimeout(() => { confirm() }, 3000) in the dev tools of a random tab and then close the dev tools, then the confirm still appears there. But with the actual code running on my page...nothing.

Edit - it may be that it only appears if my focus is on the page in question? Is there a rule around that?

about 4 years ago · Juan Pablo Isaza
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!