Skip to content

Commit 7b7334c

Browse files
committed
add menu item to open places devtools; move browser debugging behind flag
1 parent be992c6 commit 7b7334c

File tree

3 files changed

+26
-18
lines changed

3 files changed

+26
-18
lines changed

js/searchbar/developmentModeNotification.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ function initialize () {
99
showResults: function () {
1010
searchbarPlugins.reset('developmentModeNotification')
1111
searchbarPlugins.addResult('developmentModeNotification', {
12-
title: 'Development Mode Enabled'
12+
title: 'Development Mode Enabled',
13+
icon: 'carbon:warning-alt'
1314
})
1415
}
1516
})

main/main.js

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ if (process.argv.some(arg => arg === '-v' || arg === '--version')) {
3131

3232
let isInstallerRunning = false
3333
const isDevelopmentMode = process.argv.some(arg => arg === '--development-mode')
34+
const isDebuggingEnabled = process.argv.some(arg => arg === '--debug-browser')
3435

3536
function clamp (n, min, max) {
3637
return Math.max(Math.min(n, max), min)

main/menu.js

+23-17
Original file line numberDiff line numberDiff line change
@@ -317,30 +317,36 @@ function buildAppMenu (options = {}) {
317317
sendIPCToWindow(window, 'inspectPage')
318318
}
319319
},
320-
{
321-
type: 'separator'
322-
},
323-
...(isDevelopmentMode ?
320+
...(isDevelopmentMode || isDebuggingEnabled ?
324321
[
322+
{
323+
type: 'separator'
324+
},
325325
{
326326
label: l('appMenuReloadBrowser'),
327327
accelerator: (isDevelopmentMode ? 'alt+CmdOrCtrl+R' : undefined),
328328
click: function (item, focusedWindow) {
329-
destroyAllViews()
330-
windows.getAll().forEach(win => win.close())
331-
createWindow()
329+
destroyAllViews()
330+
windows.getAll().forEach(win => win.close())
331+
createWindow()
332332
}
333333
},
334-
] : []),
335-
{
336-
label: l('appMenuInspectBrowser'),
337-
accelerator: (function () {
338-
if (process.platform === 'darwin') { return 'Shift+Cmd+Alt+I' } else { return 'Ctrl+Shift+Alt+I' }
339-
})(),
340-
click: function (item, focusedWindow) {
341-
if (focusedWindow) focusedWindow.toggleDevTools()
342-
}
343-
}
334+
{
335+
label: l('appMenuInspectBrowser'),
336+
accelerator: (function () {
337+
if (process.platform === 'darwin') { return 'Shift+Cmd+Alt+I' } else { return 'Ctrl+Shift+Alt+I' }
338+
})(),
339+
click: function (item, focusedWindow) {
340+
if (focusedWindow) focusedWindow.toggleDevTools()
341+
}
342+
},
343+
{
344+
label: 'Inspect Places Service',
345+
click: function (item, focusedWindow) {
346+
placesWindow.webContents.openDevTools({ mode: 'detach' })
347+
}
348+
}
349+
] : [])
344350
]
345351
},
346352
...(process.platform === 'darwin' ? [

0 commit comments

Comments
 (0)