Electron.NET icon indicating copy to clipboard operation
Electron.NET copied to clipboard

Option to run custom code inside main.js

Open lukasportal opened this issue 4 years ago • 2 comments

Today we don't have access to main.js which is the entry point for the electron app and where it starts the asp.net executable. It would be great if we had a way to maybe specify a path to a js file in the manifest where will be executed inside the main.js file.

The main reason for this is that I need to disable error dialogs so it won't stop the execution.

The code to disable the error dialogs is this:

const electron = require('electron');
const dialog = electron.dialog;

// Disable error dialogs by overriding
dialog.showErrorBox = function(title, content) {
    console.log(`${title}\n${content}`);
};

I need to have access to the electron.dialog but this is only available from the main.js file and not from the proxy where it'll only be available as electron.remote.dialog which is useless for this.

lukasportal avatar Apr 26 '21 01:04 lukasportal

or maybe just a feature to disable error box and console.error/log instead? do you know of any workaround to have this possible right now?

lukasportal avatar May 02 '21 17:05 lukasportal

@lukasportal did you find a solution to this?

ppostman avatar Oct 29 '21 14:10 ppostman

🎉🚀 New Electron.NET version 23.6.1 released 🚀🎉

With native Electron 23 and .NET 6 support. Your problem should be fixed here. If you continue to have the problem, please let us know. Please note the correct updating of your API & CLI. Info in the README. Have fun!

GregorBiswanger avatar Mar 28 '23 15:03 GregorBiswanger