Cannot get BrowserWindow icon to work

Here is my code:

mainWindow = new BrowserWindow({
    'x': 2560,
    'y': 880,
    'width': 850,
    'height': 530,
    'skip-taskbar': false,
    'icon': 'file://' + __dirname + '/../images/icon.png',
    'frame': true,

Yet I still keep seeing this icon when running:


My icon.png is a 256×256 PNG. The image file path is correct, as I am successfully starting my app with this command:

mainWindow.loadUrl('file://' + __dirname + '/../index.html');

My project is open source, here is the repo:

2 thoughts on “Cannot get BrowserWindow icon to work

  1. You don’t need to add file:// prefix in icon’s path, try using __dirname + '/../images/icon.png' instead.

  2. Pingback: 메이저놀이터

Comments are closed.