Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the browser debugging menu #2533

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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