mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-04 05:34:51 +00:00
Adding and calling custom javscript to electron .net app #900
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @domingoladron on GitHub (Jun 18, 2023).
Originally assigned to: @GregorBiswanger on GitHub.
Hey there,
I want to hook right into the electron engine via Javascript using npm etc. How do I
I have been trying to piece it all together, but so many moving parts and I just would like a bit of clarity so I can do this right.
Cheers
@GregorBiswanger commented on GitHub (Jun 20, 2023):
For this, we have the HostHook feature, which needs to be activated via the Electron.NET-CLI with the following command:
electronize add hosthookThis will create an
ElectronHostHookdirectory in your project. Ideally, you can now open this with Visual Studio Code. Install NPM packages and communicate with the actual application.Our Electron.NET API Demo App and its source code will show you exactly how to do this:
https://github.com/ElectronNET/electron.net-api-demos
https://github.com/ElectronNET/electron.net-api-demos/blob/master/ElectronNET-API-Demos/Controllers/HostHookController.cs
https://github.com/ElectronNET/electron.net-api-demos/tree/master/ElectronNET-API-Demos/ElectronHostHook
Was I able to assist you with this?
@domingoladron commented on GitHub (Jun 20, 2023):
That's exactly what I was after. Thanks so much.
Once I get my head around it and am able to do the basics, would y'all be amenable to a documentation PR with details on how to do this for others? This seems like a useful scenario for devs, as some stuff is just easier to do in javascript / typescript / electron than in Blazor.
If a documentation PR would be acceptable, do you have a preferred place (README.md?) for such docs?
Let me know and cheers for the assist