Protocol API #1011

Closed
opened 2026-01-29 16:54:52 +00:00 by claunia · 4 comments
Owner

Originally created by @Denny09310 on GitHub (Nov 17, 2025).

I’ve been experimenting with ElectronNET using a simple app, and I realized I needed to load an image from file system. While I could create a static class in C# to load the image directly as base64, I wanted to try implementing the Electron protocol API instead, for learning purposes. However, I’m not entirely sure if I’m structuring the bridge/API correctly. If anyone is willing to help me refine it, or at least explain the proper approach for future reference, I’d really appreciate it. The branch is feature/protocol-api

Originally created by @Denny09310 on GitHub (Nov 17, 2025). I’ve been experimenting with ElectronNET using a simple app, and I realized I needed to load an image from file system. While I could create a static class in C# to load the image directly as base64, I wanted to try implementing the Electron [protocol API](https://www.electronjs.org/docs/latest/api/protocol) instead, for learning purposes. However, I’m not entirely sure if I’m structuring the bridge/API correctly. If anyone is willing to help me refine it, or at least explain the proper approach for future reference, I’d really appreciate it. The branch is [feature/protocol-api](https://github.com/Denny09310/Electron.NET/tree/feature/protocol-api)
claunia added the Feature label 2026-01-29 16:54:52 +00:00
Author
Owner

@Denny09310 commented on GitHub (Nov 18, 2025):

Mmh I think it's not possible to implement at the moment. Because if I wait on the "AppReadyCallback" electron will throw an error because I can't call the "RegisterSchemesAsPrivileged" after the app is ready, but if I try to do it before, the socket is not ready and will throw an error

@Denny09310 commented on GitHub (Nov 18, 2025): Mmh I think it's not possible to implement at the moment. Because if I wait on the "AppReadyCallback" electron will throw an error because I can't call the "RegisterSchemesAsPrivileged" after the app is ready, but if I try to do it before, the socket is not ready and will throw an error
Author
Owner

@FlorianRappl commented on GitHub (Nov 18, 2025):

Good point - maybe there should be a possibility to do that. Let's tackle that in a separate issue and keep this one open. I've added a blocked label.

@FlorianRappl commented on GitHub (Nov 18, 2025): Good point - maybe there should be a possibility to do that. Let's tackle that in a separate issue and keep this one open. I've added a blocked label.
Author
Owner

@Denny09310 commented on GitHub (Nov 18, 2025):

Should I open another issue like "Better lifetime startup handling" or something similar?

Edit: Okay I think I've something, but I don't know how to correctly attach the js API to the socket

@Denny09310 commented on GitHub (Nov 18, 2025): Should I open another issue like "Better lifetime startup handling" or something similar? Edit: Okay I think I've something, but I don't know how to correctly attach the js API to the socket
Author
Owner

@FlorianRappl commented on GitHub (Nov 19, 2025):

Should be unblocked: https://github.com/ElectronNET/Electron.NET/pull/941#issuecomment-3551298374

@FlorianRappl commented on GitHub (Nov 19, 2025): Should be unblocked: https://github.com/ElectronNET/Electron.NET/pull/941#issuecomment-3551298374
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#1011