@lynker-desktop/electron-window-manager 0.0.4-alpha.6 → 0.0.4-alpha.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/common/index.d.ts +10 -1
- package/common/index.d.ts.map +1 -1
- package/esm/common/index.d.ts +10 -1
- package/esm/common/index.d.ts.map +1 -1
- package/esm/main/index.d.ts +10 -8
- package/esm/main/index.d.ts.map +1 -1
- package/esm/main/index.js +182 -64
- package/esm/main/index.js.map +1 -1
- package/esm/renderer/index.d.ts +36 -6
- package/esm/renderer/index.d.ts.map +1 -1
- package/esm/renderer/index.js +54 -28
- package/esm/renderer/index.js.map +1 -1
- package/main/index.d.ts +10 -8
- package/main/index.d.ts.map +1 -1
- package/main/index.js +181 -62
- package/main/index.js.map +1 -1
- package/package.json +2 -2
- package/renderer/index.d.ts +36 -6
- package/renderer/index.d.ts.map +1 -1
- package/renderer/index.js +56 -29
- package/renderer/index.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/renderer/index.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,KAAK,EAAC,aAAa,EAAc,MAAM,UAAU,CAAA;AACxD,OAAO,EAAE,6BAA6B,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/renderer/index.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,KAAK,EAAC,aAAa,EAAc,MAAM,UAAU,CAAA;AACxD,OAAO,EAAE,6BAA6B,EAAE,MAAM,WAAW,CAAC;AAI1D,MAAM,WAAW,iBAAkB,SAAQ,aAAa;IACtD,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB;AAsBD;;;;GAIG;AACH,eAAO,MAAM,MAAM,YAAmB,6BAA6B,KAAG,OAAO,CAAC,iBAAiB,CAW9F,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB,8CAI5B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,GAAG,aAAoB,MAAM,GAAG,MAAM,KAAG,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAW1F,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,MAAM,QAAa,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAmBrE,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,KAAK,aAAoB,MAAM,GAAG,MAAM,KAAG,OAAO,CAAC,OAAO,CAGtE,CAAA;AAED,eAAO,MAAM,QAAQ,QAAa,OAAO,CAAC,OAAO,CAGhD,CAAA;AAED;;EAEE;AACF,eAAO,MAAM,wBAAwB,iBAAwB,MAAM,2CAGlE,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,UAAU,QAEH,OAAO,CAAC,MAAM,GAAG,SAAS,CAc1C,CAAA"}
|
package/esm/renderer/index.js
CHANGED
|
@@ -6,7 +6,7 @@ const getIpc = () => {
|
|
|
6
6
|
return window?.__ELECTRON_WINDOW_MANAGER__?.ipcRenderer || window?.require('electron').ipcRenderer;
|
|
7
7
|
}
|
|
8
8
|
catch (error) {
|
|
9
|
-
console.error('
|
|
9
|
+
console.error('当前非桌面端环境, 请在桌面端中调用');
|
|
10
10
|
return {};
|
|
11
11
|
}
|
|
12
12
|
};
|
|
@@ -20,40 +20,52 @@ const getRemote = () => {
|
|
|
20
20
|
return {};
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
+
/**
|
|
24
|
+
* 创建窗口
|
|
25
|
+
* @param options
|
|
26
|
+
* @returns
|
|
27
|
+
*/
|
|
23
28
|
const create = async (options) => {
|
|
24
29
|
const remote = getRemote();
|
|
25
30
|
const data = await eIpc.RendererIPC.invokeMain('__ELECTRON_WINDOW_MANAGER_IPC_CHANNEL__', { type: 'create', data: options });
|
|
26
|
-
const
|
|
27
|
-
const win = allW.find(i => i.id === data.winId);
|
|
31
|
+
const win = remote.BrowserWindow.fromId(data.winId);
|
|
28
32
|
if (win) {
|
|
29
33
|
// @ts-ignore
|
|
30
|
-
win && (win['_name'] = data.winName);
|
|
34
|
+
win && (win['_name'] = `${data.winName}`);
|
|
35
|
+
// @ts-ignore
|
|
36
|
+
win && (win['_extraData'] = `${data.winExtraData || ''}`);
|
|
31
37
|
}
|
|
32
38
|
return win;
|
|
33
39
|
};
|
|
34
|
-
|
|
40
|
+
/**
|
|
41
|
+
* 获取当前窗口实例
|
|
42
|
+
*/
|
|
43
|
+
const getCurrentWindow = async () => {
|
|
35
44
|
const remote = getRemote();
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
const win = allW.find(i => i.id === data.winId);
|
|
39
|
-
console.error(allW, data, win);
|
|
40
|
-
if (win) {
|
|
41
|
-
// @ts-ignore
|
|
42
|
-
win && (win['_name'] = data.winName);
|
|
43
|
-
}
|
|
44
|
-
return win;
|
|
45
|
+
const winId = remote.getCurrentWindow().id;
|
|
46
|
+
return get(winId);
|
|
45
47
|
};
|
|
46
|
-
|
|
48
|
+
/**
|
|
49
|
+
* 获取窗口
|
|
50
|
+
* @param idOrName id或者名字
|
|
51
|
+
* @returns
|
|
52
|
+
*/
|
|
53
|
+
const get = async (idOrName) => {
|
|
47
54
|
const remote = getRemote();
|
|
48
|
-
const data = await getIpc().invoke('__ELECTRON_WINDOW_MANAGER_IPC_CHANNEL__', { type: '
|
|
49
|
-
const
|
|
50
|
-
const win = allW.find(i => i.id === data.winId);
|
|
55
|
+
const data = await getIpc().invoke('__ELECTRON_WINDOW_MANAGER_IPC_CHANNEL__', { type: 'get', data: idOrName });
|
|
56
|
+
const win = remote.BrowserWindow.fromId(data.winId);
|
|
51
57
|
if (win) {
|
|
52
58
|
// @ts-ignore
|
|
53
|
-
win && (win['_name'] = data.winName);
|
|
59
|
+
win && (win['_name'] = `${data.winName || ''}`);
|
|
60
|
+
// @ts-ignore
|
|
61
|
+
win && (win['_extraData'] = `${data.winExtraData || ''}`);
|
|
54
62
|
}
|
|
55
63
|
return win;
|
|
56
64
|
};
|
|
65
|
+
/**
|
|
66
|
+
* 获取所有窗口
|
|
67
|
+
* @returns
|
|
68
|
+
*/
|
|
57
69
|
const getAll = async () => {
|
|
58
70
|
const remote = getRemote();
|
|
59
71
|
const data = await getIpc().invoke('__ELECTRON_WINDOW_MANAGER_IPC_CHANNEL__', { type: 'getAll', data: undefined });
|
|
@@ -62,23 +74,37 @@ const getAll = async () => {
|
|
|
62
74
|
for (const key in data) {
|
|
63
75
|
const element = data[key];
|
|
64
76
|
const win = allW.find(i => {
|
|
65
|
-
return `${i.id}` === `${element
|
|
77
|
+
return `${i.id}` === `${element?.winId}`;
|
|
66
78
|
});
|
|
67
79
|
if (win) {
|
|
68
80
|
// @ts-ignore
|
|
69
|
-
win && (win['_name'] = element
|
|
81
|
+
win && (win['_name'] = `${element?.winName || ''}`);
|
|
82
|
+
// @ts-ignore
|
|
83
|
+
win && (win['_extraData'] = `${element?.winExtraData || ''}`);
|
|
70
84
|
wins.set(key, win);
|
|
71
85
|
}
|
|
72
86
|
}
|
|
73
87
|
return wins;
|
|
74
88
|
};
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
89
|
+
/**
|
|
90
|
+
* 关闭窗口
|
|
91
|
+
* @param name
|
|
92
|
+
* @returns
|
|
93
|
+
*/
|
|
94
|
+
const close = async (idOrName) => {
|
|
95
|
+
await getIpc().invoke('__ELECTRON_WINDOW_MANAGER_IPC_CHANNEL__', { type: 'close', data: idOrName });
|
|
96
|
+
return true;
|
|
97
|
+
};
|
|
98
|
+
const closeAll = async () => {
|
|
99
|
+
await getIpc().invoke('__ELECTRON_WINDOW_MANAGER_IPC_CHANNEL__', { type: 'closeAll', data: undefined });
|
|
100
|
+
return true;
|
|
78
101
|
};
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
102
|
+
/**
|
|
103
|
+
* 用webContentIds查找到window
|
|
104
|
+
*/
|
|
105
|
+
const getWindowForWebContentId = async (webContentId) => {
|
|
106
|
+
const winId = await getIpc().invoke('__ELECTRON_WINDOW_MANAGER_IPC_CHANNEL__', { type: 'getWindowForWebContentId', data: webContentId });
|
|
107
|
+
return get(winId);
|
|
82
108
|
};
|
|
83
109
|
/**
|
|
84
110
|
* 获取 preload
|
|
@@ -112,5 +138,5 @@ getPreload();
|
|
|
112
138
|
// document.body.addEventListener('keydown', handleOpenDevTools)
|
|
113
139
|
// }
|
|
114
140
|
|
|
115
|
-
export { close,
|
|
141
|
+
export { close, closeAll, create, get, getAll, getCurrentWindow, getPreload, getWindowForWebContentId };
|
|
116
142
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/renderer/index.ts"],"sourcesContent":["/** Used in Renderer process */\nimport type {BrowserWindow, IpcRenderer} from 'electron'\nimport { ElectronWindowsManagerOptions } from '../common';\nimport type RemoteType from '@electron/remote'\nimport
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/renderer/index.ts"],"sourcesContent":["/** Used in Renderer process */\nimport type {BrowserWindow, IpcRenderer} from 'electron'\nimport { ElectronWindowsManagerOptions } from '../common';\nimport type RemoteType from '@electron/remote'\nimport eIpc from '@lynker-desktop/electron-ipc/renderer'\n\nexport interface BrowserWindowType extends BrowserWindow {\n _name: string;\n _extraData: string;\n}\n\nconst getIpc = (): IpcRenderer => {\n try {\n // @ts-ignore\n return window?.__ELECTRON_WINDOW_MANAGER__?.ipcRenderer || window?.require('electron').ipcRenderer\n } catch (error) {\n console.error('当前非桌面端环境, 请在桌面端中调用');\n return {} as IpcRenderer;\n }\n}\n\nconst getRemote = (): typeof RemoteType => {\n try {\n // @ts-ignore\n return window?.__ELECTRON_WINDOW_MANAGER__?.remote || window?.require('@electron/remote')\n } catch (error) {\n console.error('getIpc error: ', error)\n return {} as typeof RemoteType;\n }\n}\n\n/**\n * 创建窗口\n * @param options\n * @returns\n */\nexport const create = async (options: ElectronWindowsManagerOptions): Promise<BrowserWindowType> => {\n const remote = getRemote()\n const data: {winId: number; winName: string} = await eIpc.RendererIPC.invokeMain('__ELECTRON_WINDOW_MANAGER_IPC_CHANNEL__', {type: 'create', data: options})\n const win = remote.BrowserWindow.fromId(data.winId)! as BrowserWindowType;\n if (win) {\n // @ts-ignore\n win && (win['_name'] = `${data.winName}`);\n // @ts-ignore\n win && (win['_extraData'] = `${data.winExtraData || ''}`);\n }\n return win;\n}\n\n/**\n * 获取当前窗口实例\n */\nexport const getCurrentWindow = async () => {\n const remote = getRemote();\n const winId = remote.getCurrentWindow().id;\n return get(winId);\n}\n\n/**\n * 获取窗口\n * @param idOrName id或者名字\n * @returns\n */\nexport const get = async (idOrName: string | number): Promise<BrowserWindowType | undefined> => {\n const remote = getRemote()\n const data: {winId: number; winName: string, winExtraData: string} = await getIpc().invoke('__ELECTRON_WINDOW_MANAGER_IPC_CHANNEL__', {type: 'get', data: idOrName})\n const win = remote.BrowserWindow.fromId(data.winId)! as BrowserWindowType;\n if (win) {\n // @ts-ignore\n win && (win['_name'] = `${data.winName || ''}`);\n // @ts-ignore\n win && (win['_extraData'] = `${data.winExtraData|| ''}`);\n }\n return win;\n}\n\n/**\n * 获取所有窗口\n * @returns\n */\nexport const getAll = async (): Promise<Map<number, BrowserWindowType>> => {\n const remote = getRemote()\n const data = await getIpc().invoke('__ELECTRON_WINDOW_MANAGER_IPC_CHANNEL__', {type: 'getAll', data: undefined})\n const wins = new Map();\n const allW = remote.BrowserWindow.getAllWindows()\n for (const key in data) {\n const element = data[key];\n const win = allW.find(i => {\n return `${i.id}` === `${element?.winId}`\n })\n if (win) {\n // @ts-ignore\n win && (win['_name'] = `${element?.winName || ''}`);\n // @ts-ignore\n win && (win['_extraData'] = `${element?.winExtraData|| ''}`);\n wins.set(key, win)\n }\n }\n return wins;\n}\n\n/**\n * 关闭窗口\n * @param name\n * @returns\n */\nexport const close = async (idOrName: string | number): Promise<boolean> => {\n await getIpc().invoke('__ELECTRON_WINDOW_MANAGER_IPC_CHANNEL__', {type: 'close', data: idOrName})\n return true;\n}\n\nexport const closeAll = async (): Promise<boolean> => {\n await getIpc().invoke('__ELECTRON_WINDOW_MANAGER_IPC_CHANNEL__', {type: 'closeAll', data: undefined})\n return true;\n}\n\n/**\n * 用webContentIds查找到window\n*/\nexport const getWindowForWebContentId = async (webContentId: number) => {\n const winId = await getIpc().invoke('__ELECTRON_WINDOW_MANAGER_IPC_CHANNEL__', {type: 'getWindowForWebContentId', data: webContentId})\n return get(winId);\n}\n\n/**\n * 获取 preload\n * @returns\n */\nexport const getPreload = (() => {\n let cachePreload: undefined | string = undefined;\n return async (): Promise<string | undefined> => {\n if (cachePreload) {\n return cachePreload;\n }\n const data: string | undefined = await getIpc().invoke(\n '__ELECTRON_WINDOW_MANAGER_IPC_CHANNEL__',\n {\n type: 'getPreload',\n data: undefined,\n }\n )\n cachePreload = data;\n return data;\n }\n})()\n\ngetPreload();\n\n// const handleOpenDevTools = (e: HTMLElement, ev: KeyboardEvent): any => {\n// const remote = getRemote()\n// const webContents = remote.getCurrentWebContents()\n// webContents.openDevTools({\n// mode: 'detach'\n// })\n// return '';\n// }\n\n// export const registerDevTools = () => {\n// document.body.removeEventListener('keydown', handleOpenDevTools)\n// document.body.addEventListener('keydown', handleOpenDevTools)\n// }\n"],"names":[],"mappings":";;AAWA,MAAM,MAAM,GAAG,MAAkB;AAC/B,IAAA,IAAI;;AAEF,QAAA,OAAO,MAAM,EAAE,2BAA2B,EAAE,WAAW,IAAI,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC,WAAW,CAAA;KACnG;IAAC,OAAO,KAAK,EAAE;AACd,QAAA,OAAO,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;AACpC,QAAA,OAAO,EAAiB,CAAC;KAC1B;AACH,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,MAAwB;AACxC,IAAA,IAAI;;AAEF,QAAA,OAAO,MAAM,EAAE,2BAA2B,EAAE,MAAM,IAAI,M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AACE,YAAA,IAAI,EAAE,YAAY;AAClB,YAAA,IAAI,EAAE,SAAS;AAChB,SAAA,CACF,CAAA;QACD,YAAY,GAAG,IAAI,CAAC;AACpB,QAAA,OAAO,IAAI,CAAC;AACd,KAAC,CAAA;AACH,CAAC,IAAG;AAEJ,UAAU,EAAE,CAAC;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;;;;"}
|
package/main/index.d.ts
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import { WebContents } from 'electron';
|
|
2
2
|
import type { ElectronWindowsManagerOptions, WindowItem } from '../common';
|
|
3
|
+
export declare const getCustomSession: () => Electron.Session;
|
|
3
4
|
export declare const enable: (win: WebContents) => void;
|
|
4
5
|
export declare class WindowsManager {
|
|
6
|
+
loadingViewUrl: string | undefined;
|
|
7
|
+
errorViewUrl: string | undefined;
|
|
5
8
|
preload?: string;
|
|
6
|
-
windows: Map<number, WindowItem>;
|
|
7
|
-
constructor(preload?: string);
|
|
9
|
+
windows: Map<number, WindowItem | null>;
|
|
10
|
+
constructor(preload?: string, loadingViewUrl?: string, errorViewUrl?: string);
|
|
8
11
|
create(options: ElectronWindowsManagerOptions): WindowItem;
|
|
9
12
|
_setLoadingView(window: WindowItem, createOptions: ElectronWindowsManagerOptions): void;
|
|
10
|
-
get(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
closeById(id: number): undefined;
|
|
13
|
+
get(idOrName: string | number): WindowItem | undefined;
|
|
14
|
+
getAll(): Map<number, WindowItem | null>;
|
|
15
|
+
close(idOrName: string | number): undefined;
|
|
16
|
+
closeAll(): void;
|
|
15
17
|
getPreload(): string | undefined;
|
|
16
18
|
}
|
|
17
19
|
export declare let isInitialized: boolean;
|
|
18
|
-
export declare const initialize: (preload?: string) => WindowsManager;
|
|
20
|
+
export declare const initialize: (preload?: string, loadingViewUrl?: string, errorViewUrl?: string) => WindowsManager;
|
|
19
21
|
//# sourceMappingURL=index.d.ts.map
|
package/main/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/main/index.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/main/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAmC,WAAW,EAAkE,MAAM,UAAU,CAAA;AAGvI,OAAO,KAAK,EAAE,6BAA6B,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE3E,eAAO,MAAM,gBAAgB,wBAQzB,CAAC;AAUL,eAAO,MAAM,MAAM,QAAS,WAAW,SAEtC,CAAA;AAED,qBAAa,cAAc;IACzB,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC,CAAC;gBAC5B,OAAO,CAAC,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM;IAO5E,MAAM,CAAC,OAAO,EAAE,6BAA6B;IAyG7C,eAAe,CAAC,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,6BAA6B;IAmFhF,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS;IA+BtD,MAAM;IAYN,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAoB/B,QAAQ;IAQR,UAAU;CAIX;AAID,eAAO,IAAI,aAAa,SAAQ,CAAC;AAEjC,eAAO,MAAM,UAAU,aAAc,MAAM,mBAAmB,MAAM,iBAAiB,MAAM,KAAG,cA4H7F,CAAA"}
|
package/main/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const lodash = require('lodash');
|
|
2
2
|
const electron = require('electron');
|
|
3
3
|
const remote = require('@electron/remote/main');
|
|
4
4
|
const eIpc = require('@lynker-desktop/electron-ipc/main');
|
|
@@ -16,6 +16,18 @@ function _interopNamespaceDefault(e) {
|
|
|
16
16
|
|
|
17
17
|
const remote__namespace = /*#__PURE__*/_interopNamespaceDefault(remote);
|
|
18
18
|
|
|
19
|
+
const getCustomSession = (() => {
|
|
20
|
+
let customSession;
|
|
21
|
+
return () => {
|
|
22
|
+
if (!customSession) {
|
|
23
|
+
customSession = electron.session.fromPartition('persist:__global_main_session__');
|
|
24
|
+
}
|
|
25
|
+
return customSession;
|
|
26
|
+
};
|
|
27
|
+
})();
|
|
28
|
+
electron.app.on('ready', () => {
|
|
29
|
+
getCustomSession();
|
|
30
|
+
});
|
|
19
31
|
if (!remote__namespace.isInitialized()) {
|
|
20
32
|
remote__namespace.initialize();
|
|
21
33
|
}
|
|
@@ -23,16 +35,49 @@ const enable = (win) => {
|
|
|
23
35
|
remote__namespace.enable(win);
|
|
24
36
|
};
|
|
25
37
|
class WindowsManager {
|
|
26
|
-
constructor(preload) {
|
|
38
|
+
constructor(preload, loadingViewUrl, errorViewUrl) {
|
|
27
39
|
this.preload = preload;
|
|
28
40
|
this.windows = new Map();
|
|
41
|
+
this.loadingViewUrl = `${loadingViewUrl ?? ''}`;
|
|
42
|
+
this.errorViewUrl = `${errorViewUrl ?? ''}`;
|
|
29
43
|
}
|
|
30
44
|
create(options) {
|
|
31
|
-
const { name = 'anonymous',
|
|
32
|
-
|
|
45
|
+
const { name = 'anonymous', url, loadingView = { url: undefined }, errorView = { url: undefined }, browserWindow: browserWindowOptions, openDevTools = false, preventOriginClose = false, } = options;
|
|
46
|
+
try {
|
|
47
|
+
loadingView.url = `${loadingView?.url ?? this.loadingViewUrl}`;
|
|
48
|
+
lodash.merge(options, {
|
|
49
|
+
loadingView,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
log('error', 'loadingView error:', loadingView, this.loadingViewUrl);
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
errorView.url = `${errorView?.url ?? this.errorViewUrl}`;
|
|
57
|
+
lodash.merge(options, {
|
|
58
|
+
errorView,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
log('error', 'errorView error:', errorView, this.errorViewUrl);
|
|
63
|
+
}
|
|
64
|
+
log('log', 'create', options);
|
|
65
|
+
let parentWin = undefined;
|
|
66
|
+
if (typeof browserWindowOptions?.parent === 'number') {
|
|
67
|
+
parentWin = electron.BrowserWindow.fromId(browserWindowOptions?.parent) || undefined;
|
|
68
|
+
if (parentWin) {
|
|
69
|
+
browserWindowOptions.parent = parentWin;
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
browserWindowOptions.parent = undefined;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
const window = new electron.BrowserWindow(lodash.merge({
|
|
33
76
|
acceptFirstMouse: true,
|
|
34
|
-
}, browserWindowOptions, {
|
|
77
|
+
}, (browserWindowOptions || {}), {
|
|
78
|
+
parent: parentWin,
|
|
35
79
|
webPreferences: {
|
|
80
|
+
// session: getCustomSession(),
|
|
36
81
|
plugins: true,
|
|
37
82
|
nodeIntegration: true,
|
|
38
83
|
contextIsolation: false,
|
|
@@ -44,28 +89,42 @@ class WindowsManager {
|
|
|
44
89
|
}));
|
|
45
90
|
remote__namespace.enable(window.webContents);
|
|
46
91
|
window._name = name;
|
|
92
|
+
window._extraData = `${options?.extraData || ''}`;
|
|
93
|
+
const showErrorView = lodash.debounce(() => {
|
|
94
|
+
const _url = window.webContents.getURL() || url;
|
|
95
|
+
window.webContents.executeJavaScript(`window['__ELECTRON_WINDOW_MANAGER_DID_FAIL_LOAD_URL__'] = "${_url}"`);
|
|
96
|
+
window.loadURL(`${errorView?.url}`);
|
|
97
|
+
}, 1000 * 2);
|
|
47
98
|
if (loadingView?.url) {
|
|
48
99
|
this._setLoadingView(window, options);
|
|
49
100
|
}
|
|
50
|
-
|
|
101
|
+
if (errorView?.url) {
|
|
102
|
+
window.webContents.on('did-fail-load', () => {
|
|
103
|
+
showErrorView();
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
window.addListener('close', (event) => {
|
|
107
|
+
log('log', 'close', window.id, window._name);
|
|
108
|
+
this.windows.set(window.id, null);
|
|
109
|
+
this.windows.delete(window.id);
|
|
51
110
|
if (preventOriginClose) {
|
|
52
111
|
event.preventDefault();
|
|
53
112
|
return;
|
|
54
113
|
}
|
|
114
|
+
});
|
|
115
|
+
window.addListener('closed', () => {
|
|
116
|
+
log('log', 'closed', window.id, window._name);
|
|
117
|
+
this.windows.set(window.id, null);
|
|
55
118
|
this.windows.delete(window.id);
|
|
56
119
|
});
|
|
57
120
|
window.webContents.on('dom-ready', () => {
|
|
121
|
+
showErrorView.cancel();
|
|
58
122
|
if (openDevTools) {
|
|
59
123
|
window.webContents.openDevTools();
|
|
60
124
|
}
|
|
61
125
|
});
|
|
62
126
|
this.windows.set(window.id, window);
|
|
63
|
-
|
|
64
|
-
window.loadFile(options.url);
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
window.loadURL(options.url);
|
|
68
|
-
}
|
|
127
|
+
window.loadURL(options.url);
|
|
69
128
|
window.focus();
|
|
70
129
|
return window;
|
|
71
130
|
}
|
|
@@ -74,6 +133,7 @@ class WindowsManager {
|
|
|
74
133
|
const { loadingView, preventOriginNavigate = false, } = createOptions;
|
|
75
134
|
let _loadingView = new electron.BrowserView({
|
|
76
135
|
webPreferences: {
|
|
136
|
+
// session: getCustomSession(),
|
|
77
137
|
contextIsolation: false,
|
|
78
138
|
nodeIntegration: true,
|
|
79
139
|
// 允许loadURL与文件路径在开发环境
|
|
@@ -92,9 +152,10 @@ class WindowsManager {
|
|
|
92
152
|
width: viewWidth || 10,
|
|
93
153
|
height: viewHeight || 10,
|
|
94
154
|
});
|
|
155
|
+
log('log', 'loadLoadingView', window._name, loadingView);
|
|
95
156
|
_loadingView.webContents.loadURL(loadingView?.url || '');
|
|
96
157
|
};
|
|
97
|
-
const onFailure = () => {
|
|
158
|
+
const onFailure = lodash.debounce(() => {
|
|
98
159
|
if (_loadingView.webContents && !_loadingView.webContents.isDestroyed()) {
|
|
99
160
|
_loadingView.webContents.close();
|
|
100
161
|
}
|
|
@@ -104,9 +165,9 @@ class WindowsManager {
|
|
|
104
165
|
if (window) {
|
|
105
166
|
window.removeBrowserView(_loadingView);
|
|
106
167
|
}
|
|
107
|
-
};
|
|
168
|
+
}, 300);
|
|
108
169
|
loadLoadingView();
|
|
109
|
-
window.on('resize',
|
|
170
|
+
window.on('resize', lodash.debounce(() => {
|
|
110
171
|
if (_loadingView.webContents && !_loadingView.webContents.isDestroyed()) {
|
|
111
172
|
if (window.isDestroyed()) {
|
|
112
173
|
return;
|
|
@@ -136,34 +197,65 @@ class WindowsManager {
|
|
|
136
197
|
window.webContents.on('crashed', onFailure);
|
|
137
198
|
window.webContents.on('unresponsive', onFailure);
|
|
138
199
|
window.webContents.on('did-fail-load', onFailure);
|
|
200
|
+
window.webContents.on('did-finish-load', onFailure);
|
|
201
|
+
window.webContents.on('did-stop-loading', onFailure);
|
|
139
202
|
}
|
|
140
203
|
}
|
|
141
|
-
get(
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
204
|
+
get(idOrName) {
|
|
205
|
+
log('log', 'get', idOrName);
|
|
206
|
+
let win;
|
|
207
|
+
this.windows.forEach((i, key) => {
|
|
208
|
+
try {
|
|
209
|
+
if (!(i && i?.webContents?.isDestroyed && !i?.webContents?.isDestroyed?.())) {
|
|
210
|
+
this.windows.set(key, null);
|
|
211
|
+
this.windows.delete(key);
|
|
212
|
+
i = null;
|
|
213
|
+
}
|
|
146
214
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
215
|
+
catch (error) {
|
|
216
|
+
log('error', 'get');
|
|
217
|
+
}
|
|
218
|
+
if (typeof idOrName === 'number') {
|
|
219
|
+
if (i?.id === idOrName) {
|
|
220
|
+
win = i;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
else if (typeof idOrName === 'string') {
|
|
224
|
+
if (i?._name === idOrName) {
|
|
225
|
+
win = i;
|
|
226
|
+
}
|
|
155
227
|
}
|
|
156
228
|
});
|
|
157
|
-
|
|
229
|
+
// @ts-ignore
|
|
230
|
+
if (win && win?.webContents?.isDestroyed && !win?.webContents?.isDestroyed?.()) {
|
|
231
|
+
return win;
|
|
232
|
+
}
|
|
233
|
+
return undefined;
|
|
158
234
|
}
|
|
159
235
|
getAll() {
|
|
236
|
+
log('log', 'getAll');
|
|
237
|
+
this.windows.forEach((win, key) => {
|
|
238
|
+
console.log(key, win);
|
|
239
|
+
if (!(win && win?.webContents?.isDestroyed && !win?.webContents?.isDestroyed?.())) {
|
|
240
|
+
this.windows.set(key, null);
|
|
241
|
+
this.windows.delete(key);
|
|
242
|
+
}
|
|
243
|
+
});
|
|
160
244
|
return this.windows;
|
|
161
245
|
}
|
|
162
|
-
close(
|
|
246
|
+
close(idOrName) {
|
|
247
|
+
log('log', 'close', idOrName);
|
|
163
248
|
let win = undefined;
|
|
164
249
|
this.windows.forEach((i) => {
|
|
165
|
-
if (
|
|
166
|
-
|
|
250
|
+
if (typeof idOrName === 'number') {
|
|
251
|
+
if (i?.id === idOrName) {
|
|
252
|
+
win = i;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
else if (typeof idOrName === 'string') {
|
|
256
|
+
if (i?._name === idOrName) {
|
|
257
|
+
win = i;
|
|
258
|
+
}
|
|
167
259
|
}
|
|
168
260
|
});
|
|
169
261
|
// @ts-ignore
|
|
@@ -171,26 +263,22 @@ class WindowsManager {
|
|
|
171
263
|
// @ts-ignore
|
|
172
264
|
return win && win?.destroy();
|
|
173
265
|
}
|
|
174
|
-
|
|
175
|
-
|
|
266
|
+
closeAll() {
|
|
267
|
+
log('log', 'closeAll');
|
|
176
268
|
this.windows.forEach((i) => {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
}
|
|
269
|
+
i && this.windows.delete(i?.id);
|
|
270
|
+
i && i?.destroy();
|
|
180
271
|
});
|
|
181
|
-
// @ts-ignore
|
|
182
|
-
win && this.windows.delete(win?.id);
|
|
183
|
-
// @ts-ignore
|
|
184
|
-
return win && win?.destroy();
|
|
185
272
|
}
|
|
186
273
|
getPreload() {
|
|
274
|
+
log('log', 'getPreload');
|
|
187
275
|
return this.preload;
|
|
188
276
|
}
|
|
189
277
|
}
|
|
190
278
|
// @ts-ignore
|
|
191
279
|
global['__ELECTRON_WINDOWS_MANAGER__'] = undefined;
|
|
192
280
|
exports.isInitialized = false;
|
|
193
|
-
const initialize = (preload) => {
|
|
281
|
+
const initialize = (preload, loadingViewUrl, errorViewUrl) => {
|
|
194
282
|
// @ts-ignore
|
|
195
283
|
if (exports.isInitialized && global['__ELECTRON_WINDOWS_MANAGER__']) {
|
|
196
284
|
// @ts-ignore
|
|
@@ -198,7 +286,7 @@ const initialize = (preload) => {
|
|
|
198
286
|
}
|
|
199
287
|
exports.isInitialized = true;
|
|
200
288
|
// @ts-ignore
|
|
201
|
-
const wm = global['__ELECTRON_WINDOWS_MANAGER__'] = new WindowsManager(preload);
|
|
289
|
+
const wm = global['__ELECTRON_WINDOWS_MANAGER__'] = new WindowsManager(preload, loadingViewUrl, errorViewUrl);
|
|
202
290
|
eIpc.mainIPC.handleRenderer('__ELECTRON_WINDOW_MANAGER_IPC_CHANNEL__', async (data) => {
|
|
203
291
|
if (data?.type === 'create') {
|
|
204
292
|
const opt = data;
|
|
@@ -206,30 +294,25 @@ const initialize = (preload) => {
|
|
|
206
294
|
if (findWin) {
|
|
207
295
|
findWin.focus();
|
|
208
296
|
return {
|
|
209
|
-
winId: findWin?.id,
|
|
210
|
-
winName: findWin?._name
|
|
297
|
+
winId: Number(`${findWin?.id || -1}`),
|
|
298
|
+
winName: `${findWin?._name || ''}`,
|
|
299
|
+
winExtraData: `${findWin?._extraData || ''}`,
|
|
211
300
|
};
|
|
212
301
|
}
|
|
213
302
|
const res = wm.create(opt.data);
|
|
214
303
|
return {
|
|
215
|
-
winId: Number(res.id),
|
|
216
|
-
winName: res
|
|
304
|
+
winId: Number(`${res.id || -1}`),
|
|
305
|
+
winName: `${res?._name || ''}`,
|
|
306
|
+
winExtraData: `${res?._extraData || ''}`,
|
|
217
307
|
};
|
|
218
308
|
}
|
|
219
309
|
if (data?.type === 'get') {
|
|
220
310
|
const opt = data;
|
|
221
311
|
const res = wm.get(opt?.data);
|
|
222
312
|
return {
|
|
223
|
-
winId:
|
|
224
|
-
winName: res?._name
|
|
225
|
-
|
|
226
|
-
}
|
|
227
|
-
if (data?.type === 'getById') {
|
|
228
|
-
const opt = data;
|
|
229
|
-
const res = wm.getById(opt?.data);
|
|
230
|
-
return {
|
|
231
|
-
winId: res?.id ? Number(res?.id) : -1,
|
|
232
|
-
winName: res?._name ? res?._name : '',
|
|
313
|
+
winId: Number(`${res?.id || -1}`),
|
|
314
|
+
winName: `${res?._name || ''}`,
|
|
315
|
+
winExtraData: `${res?._extraData || ''}`,
|
|
233
316
|
};
|
|
234
317
|
}
|
|
235
318
|
if (data?.type === 'getAll') {
|
|
@@ -238,8 +321,9 @@ const initialize = (preload) => {
|
|
|
238
321
|
res.forEach(i => {
|
|
239
322
|
// @ts-ignore
|
|
240
323
|
obj[i.id] = {
|
|
241
|
-
winId:
|
|
242
|
-
winName: i?._name
|
|
324
|
+
winId: Number(`${i?.id || -1}`),
|
|
325
|
+
winName: `${i?._name || ''}`,
|
|
326
|
+
winExtraData: `${i?._extraData || ''}`,
|
|
243
327
|
};
|
|
244
328
|
});
|
|
245
329
|
return obj;
|
|
@@ -249,11 +333,36 @@ const initialize = (preload) => {
|
|
|
249
333
|
const res = wm.close(opt?.data);
|
|
250
334
|
return res;
|
|
251
335
|
}
|
|
252
|
-
if (data?.type === '
|
|
253
|
-
const
|
|
254
|
-
const res = wm.closeById(opt?.data);
|
|
336
|
+
if (data?.type === 'closeAll') {
|
|
337
|
+
const res = wm.closeAll();
|
|
255
338
|
return res;
|
|
256
339
|
}
|
|
340
|
+
if (data?.type === 'getWindowForWebContentId') {
|
|
341
|
+
const opt = data;
|
|
342
|
+
const targetWebContents = electron.webContents.fromId(opt.data);
|
|
343
|
+
if (targetWebContents) {
|
|
344
|
+
let win = electron.BrowserWindow.fromWebContents(targetWebContents);
|
|
345
|
+
if (!win) {
|
|
346
|
+
// 获取所有的 BrowserWindows
|
|
347
|
+
let allWindows = electron.BrowserWindow.getAllWindows();
|
|
348
|
+
// 遍历所有窗口,检查每个窗口的 BrowserView
|
|
349
|
+
for (let _win of allWindows) {
|
|
350
|
+
let views = _win.getBrowserViews();
|
|
351
|
+
// 遍历窗口的所有 BrowserView
|
|
352
|
+
for (let view of views) {
|
|
353
|
+
if (view.webContents === targetWebContents) {
|
|
354
|
+
win = _win;
|
|
355
|
+
break;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
if (win)
|
|
359
|
+
break;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
return win?.id;
|
|
363
|
+
}
|
|
364
|
+
return undefined;
|
|
365
|
+
}
|
|
257
366
|
if (data?.type === 'getPreload') {
|
|
258
367
|
const res = wm.getPreload();
|
|
259
368
|
return res;
|
|
@@ -262,8 +371,18 @@ const initialize = (preload) => {
|
|
|
262
371
|
});
|
|
263
372
|
return wm;
|
|
264
373
|
};
|
|
374
|
+
const log = (type, ...data) => {
|
|
375
|
+
const key = `[electron-window-manager]: `;
|
|
376
|
+
try {
|
|
377
|
+
console[type](key, ...data);
|
|
378
|
+
}
|
|
379
|
+
catch (error) {
|
|
380
|
+
console.error(key, error);
|
|
381
|
+
}
|
|
382
|
+
};
|
|
265
383
|
|
|
266
384
|
exports.WindowsManager = WindowsManager;
|
|
267
385
|
exports.enable = enable;
|
|
386
|
+
exports.getCustomSession = getCustomSession;
|
|
268
387
|
exports.initialize = initialize;
|
|
269
388
|
//# sourceMappingURL=index.js.map
|