mirror of
https://github.com/HugoAura/Seewo-HugoAura.git
synced 2026-06-21 23:54:26 +08:00
[🤯 Refactor] Use standalone window for WebSocket connections
1. [-] 删除了对于 desktopAssistant 的 Hook 逻辑 2. [/] 现在不再使用 desktopAssistant 保活 WS 连接, 而是用一个单独的不可见窗口处理 WS (#25)
This commit is contained in:
39
src/aura/utils/pls.js
Normal file
39
src/aura/utils/pls.js
Normal file
@@ -0,0 +1,39 @@
|
||||
// @ts-check
|
||||
|
||||
/**
|
||||
* @param {Electron} electron
|
||||
*/
|
||||
const createWsWindow = (electron) => {
|
||||
const path = require("path");
|
||||
const { BrowserWindow } = electron;
|
||||
const window = new BrowserWindow({
|
||||
width: 0,
|
||||
height: 0,
|
||||
frame: false,
|
||||
skipTaskbar: true,
|
||||
transparent: true,
|
||||
alwaysOnTop: true,
|
||||
webPreferences: {
|
||||
nodeIntegration: true,
|
||||
contextIsolation: false,
|
||||
devTools: true,
|
||||
},
|
||||
});
|
||||
|
||||
window.setIgnoreMouseEvents(true);
|
||||
window.loadFile(
|
||||
path.join(
|
||||
__dirname,
|
||||
"..",
|
||||
"ui",
|
||||
"pages",
|
||||
"windows",
|
||||
"auraWsKeepAlive",
|
||||
"index.html"
|
||||
)
|
||||
);
|
||||
|
||||
return window;
|
||||
};
|
||||
|
||||
module.exports = { createWsWindow };
|
||||
Reference in New Issue
Block a user