Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
fix(menu): it is not possible to call toggleDevTools on browserWindow
Browse files Browse the repository at this point in the history
focusedWindow is of type BrowserWindow and was converted to type WebContents to be able to trigger toggleDevTools on it. The better way it to get webContents from focusedWindow and then call toggleDevTools
  • Loading branch information
Lasse Kuechler authored and lkuechler committed Feb 9, 2018
1 parent beb8ec3 commit 928e01c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/electron/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
MenuItem,
MenuItemConstructorOptions,
remote,
WebContents,
WebviewTag
} from 'electron';
import * as FileExtraUtils from 'fs-extra';
Expand Down Expand Up @@ -298,9 +297,9 @@ export function createMenu(store: Store): void {
return 'Ctrl+Shift+I';
}
})(),
click: (item: MenuItem, focusedWindow: WebContents) => {
click: (item: MenuItem, focusedWindow: BrowserWindow) => {
if (focusedWindow) {
focusedWindow.toggleDevTools();
focusedWindow.webContents.toggleDevTools();
}
}
}
Expand Down

0 comments on commit 928e01c

Please sign in to comment.