From 826a571b602783c33e9177d9026147c27c675e91 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 17 May 2017 10:05:50 +0100 Subject: [PATCH] apply same image to the window/taskbar too; as per request LETS MAKE IT CLEAR WE ARE NEEDY AND WANT ATTENTION Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- electron_app/src/tray.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/electron_app/src/tray.js b/electron_app/src/tray.js index 7198356c..98ffb9f4 100644 --- a/electron_app/src/tray.js +++ b/electron_app/src/tray.js @@ -61,7 +61,14 @@ exports.create = function(win, config) { trayIcon.on('click', toggleWin); win.webContents.on('page-favicon-updated', function(ev, favicons) { - trayIcon.setImage(nativeImage.createFromDataURL(favicons[0])); + if (favicons && favicons.length > 0 && favicons[0].startsWith('data:')) { + const image = nativeImage.createFromDataURL(favicons[0]); + trayIcon.setImage(image); + win.setIcon(image); + } else { + trayIcon.setImage(config.icon_path); + win.setIcon(config.icon_path); + } }); win.webContents.on('page-title-updated', function(ev, title) {