I am trying to load a log-out URL once the app close button is hit,
Something like the following. Problem is that I am receiving an error that the window is already closed and can't load. Any help achieve this will be appreciated.
app.on('ready', function () {
// Create new window
mainWindow = new BrowserWindow({webPreferences: {
nodeIntegration: false
}});
// Load php index into window
mainWindow.setTitle('Test');
mainWindow.loadURL('
http://www.url.com/index.php');
//mainWindow.webContents.openDevTools();
mainWindow.setMenu(null);
mainWindow.on('closed', () => {
mainWindow.loadURL('
https://www.url.com/logout.php?logout=true');
mainWindow = null;
app.quit();
});
});
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)