MCPcopy
hub / github.com/wavetermdev/waveterm / getWindowWebContents

Function getWindowWebContents

emain/emain-menu.ts:30–46  ·  view source on GitHub ↗
(window: electron.BaseWindow)

Source from the content-addressed store, hash-verified

28};
29
30function getWindowWebContents(window: electron.BaseWindow): electron.WebContents {
31 if (window == null) {
32 return null;
33 }
34 // Check BrowserWindow first (for Tsunami Builder windows)
35 if (window instanceof electron.BrowserWindow) {
36 return window.webContents;
37 }
38 // Check WaveBrowserWindow (for main Wave windows with tab views)
39 if (window instanceof WaveBrowserWindow) {
40 if (window.activeTabView) {
41 return window.activeTabView.webContents;
42 }
43 return null;
44 }
45 return null;
46}
47
48async function getWorkspaceMenu(ww?: WaveBrowserWindow): Promise<Electron.MenuItemConstructorOptions[]> {
49 const workspaceList = await RpcApi.WorkspaceListCommand(ElectronWshClient);

Callers 2

makeAppMenuItemsFunction · 0.85
makeViewMenuFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected