Skip to content

Commit

Permalink
add menu item to open places devtools; move browser debugging behind …
Browse files Browse the repository at this point in the history
…flag
  • Loading branch information
PalmerAL committed Dec 13, 2024
1 parent be992c6 commit 7b7334c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 18 deletions.
3 changes: 2 additions & 1 deletion js/searchbar/developmentModeNotification.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ function initialize () {
showResults: function () {
searchbarPlugins.reset('developmentModeNotification')
searchbarPlugins.addResult('developmentModeNotification', {
title: 'Development Mode Enabled'
title: 'Development Mode Enabled',
icon: 'carbon:warning-alt'
})
}
})
Expand Down
1 change: 1 addition & 0 deletions main/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ if (process.argv.some(arg => arg === '-v' || arg === '--version')) {

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

function clamp (n, min, max) {
return Math.max(Math.min(n, max), min)
Expand Down
40 changes: 23 additions & 17 deletions main/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,30 +317,36 @@ function buildAppMenu (options = {}) {
sendIPCToWindow(window, 'inspectPage')
}
},
{
type: 'separator'
},
...(isDevelopmentMode ?
...(isDevelopmentMode || isDebuggingEnabled ?
[
{
type: 'separator'
},
{
label: l('appMenuReloadBrowser'),
accelerator: (isDevelopmentMode ? 'alt+CmdOrCtrl+R' : undefined),
click: function (item, focusedWindow) {
destroyAllViews()
windows.getAll().forEach(win => win.close())
createWindow()
destroyAllViews()
windows.getAll().forEach(win => win.close())
createWindow()
}
},
] : []),
{
label: l('appMenuInspectBrowser'),
accelerator: (function () {
if (process.platform === 'darwin') { return 'Shift+Cmd+Alt+I' } else { return 'Ctrl+Shift+Alt+I' }
})(),
click: function (item, focusedWindow) {
if (focusedWindow) focusedWindow.toggleDevTools()
}
}
{
label: l('appMenuInspectBrowser'),
accelerator: (function () {
if (process.platform === 'darwin') { return 'Shift+Cmd+Alt+I' } else { return 'Ctrl+Shift+Alt+I' }
})(),
click: function (item, focusedWindow) {
if (focusedWindow) focusedWindow.toggleDevTools()
}
},
{
label: 'Inspect Places Service',
click: function (item, focusedWindow) {
placesWindow.webContents.openDevTools({ mode: 'detach' })
}
}
] : [])
]
},
...(process.platform === 'darwin' ? [
Expand Down

0 comments on commit 7b7334c

Please sign in to comment.