0

I need to set an icon beside the title of BrowserWindow like favicon is seen in Chrome.

It doesn’t work even if I put it in HTML.

<link rel="icon" type="image/x-icon" href="favicon.ico" />

I tried doing the following as well:

mainWindow = new BrowserWindow({
 width: 1200,
 height: 800,
 icon: path.resolve(__dirname, ‘favicon.ico’)
})

But it doesn’t work. Is it actually possible?

Note: I am not talking about the app icon. I want an icon beside the title which is beside the traffic lights. For example, if you open VSCode for the 1st time you see Welcome at the top as shown in the image below. I want an icon besides Welcome

vscode welcome

deadcoder0904
  • 7,232
  • 12
  • 66
  • 163
  • you are using macOS, the answer is here https://stackoverflow.com/a/31538436/6771708 – namila007 Apr 15 '20 at 20:27
  • @namila007 i think that gives the icon to the app. i want it besides **Welcome** as specified in the question – deadcoder0904 Apr 16 '20 at 09:00
  • using the `icon:` it set the application icon on the specific window – namila007 Apr 16 '20 at 09:14
  • @namila007 i'll try it when i get my Mac working. charger is dead & thanks to covid-19 i cant test it right now. currently on Windows, is the solution the same for Windows? – deadcoder0904 Apr 16 '20 at 10:47
  • Ah i tried setting the icon on windows, it changes the icon of browserwindow. :) – namila007 Apr 16 '20 at 10:49
  • On macos you need to set icons using `.icns` format ,`ico` format wont work on the macOS – namila007 Apr 16 '20 at 10:50
  • @namila007 i think the same thing happens on macos as well. trust me i've tried it many times using `.icns` format only. hence the question. i don't think there's a way to do it. atleast not yet. – deadcoder0904 Apr 16 '20 at 14:11
  • 1
    yes as i read, this can only set browserWindow icon, cant set another icon next to window title – namila007 Apr 16 '20 at 14:32

1 Answers1

1

you can use

new BrowserWindow({"frame":false})

and make bar with css codes

eay
  • 176
  • 6
  • yep that's one way to do it. i've done that earlier too. i was wishing there must be a simpler way to do something like that though :) – deadcoder0904 Apr 21 '20 at 09:08