Page MenuHomePhabricator

D8369.id28309.diff
No OneTemporary

D8369.id28309.diff

diff --git a/desktop/flow-typed/npm/electron_v22.0.0.js b/desktop/flow-typed/npm/electron_v22.0.0.js
--- a/desktop/flow-typed/npm/electron_v22.0.0.js
+++ b/desktop/flow-typed/npm/electron_v22.0.0.js
@@ -240,6 +240,7 @@
};
declare export type MenuItemConstructorOptions = {
+ click?: () => void,
label?: string,
submenu?: $ReadOnlyArray<MenuItemConstructorOptions>,
type?: 'normal' | 'separator' | 'submenu' | 'checkbox' | 'radio',
@@ -439,6 +440,7 @@
event: T,
listener: $ElementType<WebContentsEvents, T>,
): void;
+ inspectSharedWorker(): void;
}
declare type WebContentsEvents = {
'did-finish-load': () => void,
diff --git a/desktop/src/main.js b/desktop/src/main.js
--- a/desktop/src/main.js
+++ b/desktop/src/main.js
@@ -29,6 +29,7 @@
'utf8',
);
+let mainWindow = null;
const setApplicationMenu = () => {
let mainMenu = [];
if (isMac) {
@@ -60,6 +61,14 @@
{ type: 'separator' },
{ role: 'togglefullscreen' },
{ role: 'toggleDevTools' },
+ {
+ label: 'Toggle Shared Worker Developer Tools',
+ click: () => {
+ if (mainWindow) {
+ mainWindow.webContents.inspectSharedWorker();
+ }
+ },
+ },
],
};
const windowMenu = {
@@ -87,7 +96,6 @@
Menu.setApplicationMenu(menu);
};
-let mainWindow = null;
const createMainWindow = (urlPath?: string) => {
const win = new BrowserWindow({
show: false,

File Metadata

Mime Type
text/plain
Expires
Fri, Jan 10, 9:11 PM (18 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2855394
Default Alt Text
D8369.id28309.diff (1 KB)

Event Timeline