How can I change the app icon from renderer or preload process in electron js? In the functions of remote, I saw this function remote.getCurrentWindow().setIcon()
, but this is not working or I don't know how to use this. Any help? Thanks in advance!
Asked
Active
Viewed 128 times
0
-
the remote module has been removed from electron (though what version are you on?). See [here](https://stackoverflow.com/questions/63852749/ipcrenderer-instead-of-remote). You'll need to use `ipcRenderer` and call [`setIcon`](https://www.electronjs.org/docs/api/browser-window#winseticonicon-windows-linux) from the main process. – pushkin May 20 '21 at 20:53
-
Does this answer your question? [Electron.remote is undefined](https://stackoverflow.com/questions/37884130/electron-remote-is-undefined) – pushkin May 20 '21 at 20:54
-
Electron remote is just set to false as default. You need to enable it in `webPreferences{}` and in it you should set `enableRemoteModule` to true. And you can't use renderer process in the latest version, you have to use preload to make it work as I had the same issue it is working now but the proble is I want the app icon to change on a specific page. – ViolaterZ May 21 '21 at 06:18