2

Is anyone who can tell me how to implement own protocol in electron app?

I use app.setAsDefaultProtocolClient method and it works fine (my application starts on request in my protocol). But I can't handle this request and catch arguments from request.

I found information that I should to use open-url event for MacOs, but how to handle it on Windows?

kedziorsc
  • 41
  • 4
  • 1
    The [documentation for app.setAsDefaultProtocolClient](https://electron.atom.io/docs/api/app/) states "The whole link, including protocol, will be passed to your application as a parameter.". I think that means a command-line argument passed to the main process, so check `process.argv` in the main process, you might find the path there. – Justin Emery Mar 21 '17 at 14:50
  • 1
    Thanks for hint. I found this information, but I don't find how to handle event on request by my protocol. – kedziorsc Mar 22 '17 at 05:35
  • Take a look at my answer in another SO question: [Pass URL scheme in a Single Instance Electron Application for Windows.](https://stackoverflow.com/questions/38458857/electron-url-scheme-open-url-event/43842895#43842895) – oikonomopo May 08 '17 at 08:36

0 Answers0