Handling custom (MyApp://) protocol on MacOS #531

Open
opened 2026-01-29 16:42:15 +00:00 by claunia · 0 comments
Owner

Originally created by @oliexe on GitHub (Jul 18, 2020).

Originally assigned to: @GregorBiswanger on GitHub.

Electron.NET version: 9.31.2
Target platform: MacOS

I need to handle the login token from the custom protocol (MyApp://) but I am unable to handle the passed arguments to the app. I have successfully registered the application as a protocol hander and it gets launched/opened in the app directly from safari by using :
await Electron.App.SetAsDefaultProtocolClientAsync("MyApp");
and setting it in-app plist (As documented).

But I don't know how to handle the passed URL. I can't do that by listening to IRC event (as documented in Electron documentation in handling the custom protocol on MacOS):
Electron.IpcMain.On("open-url", Handleprotocol());
The app gets opened/resumed when requested in safari but nothing happens. The IPC message is not published.

Is that a bug or am I doing something wrong ? cant seem to find anything similar in samples or around the net specifically for Electron.NET.

Originally created by @oliexe on GitHub (Jul 18, 2020). Originally assigned to: @GregorBiswanger on GitHub. **Electron.NET version:** 9.31.2 **Target platform:** MacOS I need to handle the login token from the custom protocol (MyApp://) but I am unable to handle the passed arguments to the app. I have successfully registered the application as a protocol hander and it gets launched/opened in the app directly from safari by using : `await Electron.App.SetAsDefaultProtocolClientAsync("MyApp"); ` and setting it in-app plist (As documented). But I don't know how to handle the passed URL. I can't do that by listening to IRC event (as documented in Electron documentation in handling the custom protocol on MacOS): `Electron.IpcMain.On("open-url", Handleprotocol());` The app gets opened/resumed when requested in safari but nothing happens. The IPC message is not published. Is that a bug or am I doing something wrong ? cant seem to find anything similar in samples or around the net specifically for Electron.NET.
claunia added the bug label 2026-01-29 16:42:15 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#531