You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, if you want Electron to open <a href=mailto:[email protected]">link to mailto</a> with default mail client, you may write:
varapp=require('app');app.on('ready',function(){varprotocol=require('protocol');protocol.registerStringProtocol('mailto',function(request,callback){require('shell').openExternal(request.url);returnnull;},function(error){if(error)console.error('Failed to register')});});
However, there are private URL schemes that are unknown to a Electron app in advance, because applications can register arbitrary schemes on a OS. How to handle them? I think there are two options:
Electron always open private URL schemes with registered applications on the OS, unless intercepted by code. I think this is the best.
Allow wildcard in protocol.registerXXXProtocol(...), e.g. protocol.registerStringProtocol('*', ...)`.
Activity