This is an excerpt from Manning's book Electron in Action. Login to get full access to this book.
Listing 6.3. Updating the window title based on the current file: ./app/renderer.js const path = require('path'); const updateUserInterface = () => { let title = 'Fire Sale'; if (filePath) { title = `${path.basename(filePath)} - ${title}`; } #1 currentWindow.setTitle(title); #2 };
const path = require('path'); const updateUserInterface = () => { let title = 'Fire Sale'; if (filePath) { title = `${path.basename(filePath)} - ${title}`; } #1 currentWindow.setTitle(title); #2 };