react-devtools: set icon on macos (#21908)
Christian Schulze committed
Jul 20, 2021 at 00:26 UTC
9b76d2d7b3a86ffde945f88b758a0537aeca027a
1 file changed
+6
packages/react-devtools/app.js
+6
@@ -9,6 +9,7 @@
9
10
const {app, BrowserWindow} = require('electron'); // Module to create native browser window.
11
const {join} = require('path');
12
+const os = require('os');
13
14
const argv = require('minimist')(process.argv.slice(2));
15
const projectRoots = argv._;
@@ -32,6 +33,11 @@ app.on('ready', function() {
33
},
34
});
35
36
+ // set dock icon for macos
37
+ if (os.platform() === 'darwin') {
38
+ app.dock.setIcon(join(__dirname, 'icons/icon128.png'));
39
+ }
40
+
41
// https://stackoverflow.com/questions/32402327/
42
mainWindow.webContents.on('new-window', function(event, url) {
43
event.preventDefault();