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

105
Views
Loading screen in window.open via electron

I wanted to show loading screen in electron js when window.open is opening some url.

example : window.open("https://example.com");

  window.webContents.on("new-window", (event, url) => {
    // there are more args not used here
    event.preventDefault();

    loading = new BrowserWindow({ width: 300, height: 300, transparent: true, frame: false, alwaysOnTop: true });
    loading.loadURL(`file://${__dirname}/splash.html`);

    const win = new BrowserWindow({ show: false, width: 1200, height: 1000 });
    win.webContents.once("dom-ready", () => {
      win.show();
      loading.hide(); // don't destroy in this case
    });
    win.loadURL(url);
    loading.show();
    event.newGuest = win;
  });

I tried above code and its working fine , except for some site is losing cookies/session when opened popup via new Browserwindow.. can i just get dom-ready callback on window.open() directly... so i can hide my loading screen...

basically i just want to window.open to open windows normally and want loading screen to be shown until pages are loaded

const win = new BrowserWindow({ show: false, width: 1200, height: 1000 });
about 4 years ago · Santiago Gelvez
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!