My colleague, who is on vacation, wrote a Javascript application that I need to port to C#. I know nothing about Javascript so at this point I'm happy if I'm just able to execute it successfully. There is a file called "index.html" and when I open this in Chrome I can see buttons, textboxes, comboboxes, etc but everything is "dead" , nothing happens when I e.g. click a button. Does anybody know how I can bring the application to life? Also, does anybody know if there exist a free IDE where I can edit the source code (it would be a bonus if I can step the code as well)? Updated information: I installed "Visual Studio Code" and opened the project folder there and when I click "Start Debugging" I see the GUI flashing by quickly and then nothing happens. In the "Terminal" window I see the following: "npm run start Debugger attached. > firmwareprogrammer@1.0.0 start > electron . Debugger attached. Main process started Waiting for the debugger to disconnect... Waiting for the debugger to disconnect..." Updated information again: I'm now able to step the code in "Visual Studio Code" and when the following function is executed, the GUI-windows are showing (but they are all white), but as soon as the function is finished executing the GUI-windows disappear:
function createWindow () {
mainWin = new BrowserWindow({
width: 1100,
height: 870,
minWidth: 1100,
maxWidth: 1100,
minHeight: 870,
maxHeight: 870,
webPreferences: {
nodeIntegration: true,
contextIsolation: false,
enableRemoteModule: true,
// preload: path.join(__dirname, "preload.js")
}
})
// mainWin.removeMenu();
// win.loadFile('index.html')
//require("@electron/remote/main").enable(win.webContents);
//mainWin.webContents.openDevTools()
devtools = new BrowserWindow();
mainWin.webContents.setDevToolsWebContents(devtools.webContents)
mainWin.webContents.openDevTools({ mode: 'detach' })
mainWin.loadURL(url.format({
pathname: path.join(__dirname, 'index.html'),
protocol: 'file',
slashes: true
}))
mainWin.webContents.openDevTools()
mainWin.on('close', () => {
mainWin = null;
})
}