我需要在 BrowserWindow
的 title
旁边设置一个图标,就像在 Chrome 中看到的 favicon
一样。
即使我把它放在 HTML 中也不起作用。
<link rel="icon" type="image/x-icon" href="favicon.ico" />
我也尝试执行以下操作:
mainWindow = new BrowserWindow({
width: 1200,
height: 800,
icon: path.resolve(__dirname, ‘favicon.ico’)
})
但是这不起作用。这真的可能吗?
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
最佳答案
你可以使用
new BrowserWindow({"frame":false})
并用CSS代码制作栏
关于javascript - 无法在 Electron 中设置除了 `BrowserWindow` 的 `title` 之外的图标,就像 Chrome 中看到的 `favicon` 一样?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60927786/