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

228
Views
window.open('my-app://', '_blank'); does not launch desktop app from the browser, but going to my-app:// in the browser does

If I open Chrome and type in my-app:// in the URL / search bar, and press enter, Chrome displays a dialog box that says "Open my-app? A website wants to open this application". I can click ok and my Electron app opens.

I have a React app and I want to add the same functionality, that programatically prompts the user to launch the application via an alert. I have tried adding window.open('my-app://', '_blank') which opens a dialog, but it is not the same as the other dialog and when I click ok, I am told by Chrome that is has blocked a pop-up, and the app does not open. I have also tried using window.location.href = 'my-app://', but it does not work. In the console I get the error: "Failed to launch 'my-app://' because the scheme does not have a registered handler."

How do I present the user with a prompt / alert that when ok is clicked will launch my app, just like it does when I enter my-app:// manually in to the browser?

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

0

Try document.location, this works for opening VS Code.

function openVSC() {
  document.location = 'vscode://open?url=';
}
<button onClick="openVSC()">Open VS Code</button>

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!