Answer the question
In order to leave comments, you need to log in
ElectronJS - is it possible to launch an exe on a click on a button in a webview?
Good day.
There is an application on ElectronJS (runs on Windows), which has a built-in webview, in which the page of my site is loaded. This is the login page for this site. After authorization, I get to another page of the site. This page has a button. Is it possible to intercept a click on this button in the application process, so that clicking on the button will launch an exe file?
It's about clicking on the button, which is located on the page of the site loaded in the webview.
If it's real, then tell me where to look, or, perhaps, poke into a specific example.
Thank you.
Answer the question
In order to leave comments, you need to log in
Yes, you can, you need to do it through the main.js process. You hang ipcRender on the button , it refers to the main process, and there it already happens using standard node.js tools
var child = require('child_process').execFile;
var executablePath = "C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe";
child(executablePath, function(err, data) {
if(err){
console.error(err);
return;
}
console.log(data.toString());
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question