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

195
Views
How to open a link in default browser in an electron app

I want to know how to open a web link in the default browser when clicked on a button in an electron app. Can anyone help me?

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

0

At the top of your main.js, make sure the following variables are defined:

const ipc = ipcMain;
const { app, BrowserWindow, ipcMain, webContents } = require('electron');

Inside your button onclick function (in the renderer), use the following:

ipc.send('SomeEvent');

Also make sure the following are defined in your renderer

const { ipcRenderer } = require('electron');
const ipc = ipcRenderer;

Then, use the following to open in the external browser (it will open in the user's default)

ipc.on('SomeEvent', ()=>{
  require('electron').shell.openExternal('<LINK_HERE>');
})
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!