Opening external link in electron


Say I’m in a desktop web browser and I click on a link such as:

<a href="myapp://">click</a>

and I want this to launch my electron application and do something according to the link. How do I accomplish this, and is this done the same way cross-platform? Is the URL schema mapping done within electron somehow?



Actually no. when you create an app, you may need to provice a main interface to work with. you could execute a function rather than using an url :

<a href="javascript:myFunction('baz',123)">click</a>

since an app is not a representative interpretation of a web server, but an app by itself, you should approach using functions that points to your logic business layer, not external resources.

It could be possible to do it using express and ipc, but it depends of the kind of project.


Are we talking about the same thing? When I’m on a web page and I click a mailto: link, it opens my mail application. I want a custom URL handler that opens my electron app.

I’m talking about clicking on a link in an external web browser, not within my electron app. [edit] I think this is along the lines of what I’m looking for:


Then it is not possible. From the browser to open an electron app you must use something like skype did, which is implementing a custom protocol to transfer the command to the app.


I’m suggest you like this:

var $ = require('jquery')
  , shell = require('shell');

// open external link
$('body').on('click', 'a[href]', function(event) {


Search APP (Asynchronous Pluggable Protocols) in Or click following link:


Not sure how new it is, but protocol might help: