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

261
Views
How can I bring Electron app to foreground every "N" minute?

I am trying to convert this EyeCare Chrome extension into an Electron app so that if you are not using the browser, this app can be installed on your machine and still reminds you to take care of your body and eyes every "N" minute.

The extension is able to open a new browser tab every "N" minute and the tab gets the focus.

I am trying to bring the Electron app to the foreground every "N" minute. I am storing the "N" value in a file and reading from it. N = User selected time (i.e. 10,20,30,40,50,60 min).

Is there a way I can make the Electron app foreground every "N" minute?

It would be great if the solution can be applied to all the platforms (Linux, Windows, and Mac).

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Use win.focus(); to bring the window to the foreground.

To focus the window every "N" minutes use setInterval like this:

var minsNum = 20; // Minutes in between each focus.
setInterval(function ()
{
    win.focus();
}, minsNum * 60 * 1000); // setInterval uses milliseconds, so we're multiplying by 1000 to get it in seconds.
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!