Commit a5da1caabea6be5eed8baecd05ca37431e9ed9eb
add "Inspect Server Process" to right click menu
Matt McKegg committed on 11/2/2016, 3:41:40 AMParent: b6089670d854fcefa6bc5ca05636a801707deb30
Files changed
index.js | changed |
lib/context-menu.js | changed |
index.js | ||
---|---|---|
@@ -28,8 +28,14 @@ | ||
28 | 28 | |
29 | 29 | electron.app.on('activate', function (e) { |
30 | 30 | openMainWindow() |
31 | 31 | }) |
32 | + | |
33 | + electron.ipcMain.on('open-background-devtools', function (ev, config) { | |
34 | + if (windows.background) { | |
35 | + windows.background.webContents.openDevTools({detach: true}) | |
36 | + } | |
37 | + }) | |
32 | 38 | }) |
33 | 39 | |
34 | 40 | function openMainWindow () { |
35 | 41 | if (!windows.main) { |
@@ -82,6 +88,10 @@ | ||
82 | 88 | title: 'patchwork-server', |
83 | 89 | useContentSize: true, |
84 | 90 | width: 150 |
85 | 91 | }) |
92 | + windows.background.on('close', (ev) => { | |
93 | + ev.preventDefault() | |
94 | + windows.background.hide() | |
95 | + }) | |
86 | 96 | } |
87 | 97 | } |
lib/context-menu.js | ||
---|---|---|
@@ -29,11 +29,19 @@ | ||
29 | 29 | var y = ev.clientY |
30 | 30 | BrowserWindow.getFocusedWindow().inspectElement(x, y) |
31 | 31 | } |
32 | 32 | })) |
33 | - | |
33 | + menu.append(new MenuItem({ | |
34 | + label: 'Inspect Server Process', | |
35 | + click: function () { | |
36 | + electron.ipcRenderer.send('open-background-devtools') | |
37 | + } | |
38 | + })) | |
34 | 39 | if (item && item.key) { |
35 | 40 | menu.append(new MenuItem({ |
41 | + type: 'separator' | |
42 | + })) | |
43 | + menu.append(new MenuItem({ | |
36 | 44 | label: 'Copy Message ID', |
37 | 45 | click: function () { |
38 | 46 | electron.clipboard.writeText(item.key) |
39 | 47 | } |
Built with git-ssb-web