Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

223
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda