mirror of
https://github.com/HugoAura/Seewo-HugoAura.git
synced 2026-06-22 08:14:26 +08:00
[🤯 Refactor] Use standalone window for WebSocket connections
1. [-] 删除了对于 desktopAssistant 的 Hook 逻辑 2. [/] 现在不再使用 desktopAssistant 保活 WS 连接, 而是用一个单独的不可见窗口处理 WS (#25)
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
// @ts-check
|
||||
|
||||
/**
|
||||
* @type {import("../../types/render/uiHook").UIHookConfig}
|
||||
*/
|
||||
const def = {
|
||||
targets: {},
|
||||
globalStyles: ["ui/css/global.css"],
|
||||
globalJS: ["ui/js/global.js", "ui/js/plsConnectionManager.js"],
|
||||
onLoaded: `
|
||||
console.log('[HugoAura / UI / Hooks / Desktop Assistant] Page loaded.');
|
||||
`,
|
||||
};
|
||||
|
||||
module.exports = def;
|
||||
@@ -1,5 +1,12 @@
|
||||
// @ts-check
|
||||
(() => {
|
||||
if (!global.__HUGO_AURA__)
|
||||
global.__HUGO_AURA__ = {
|
||||
configInit: true,
|
||||
auraDir: "",
|
||||
version: "",
|
||||
};
|
||||
|
||||
if (!global.__HUGO_AURA__.plsStats)
|
||||
global.__HUGO_AURA__.plsStats = {
|
||||
installed: false,
|
||||
@@ -12,8 +19,8 @@
|
||||
};
|
||||
|
||||
const IPC_METHOD_BASE = "$aura.pls";
|
||||
const REQUIRE_BASE = "../../aura/ui";
|
||||
const __SCOPE = "desktopAssistant";
|
||||
const REQUIRE_BASE = "../../..";
|
||||
const __SCOPE = "auraWsKeepAlive";
|
||||
|
||||
const PLS_REG_PATH = "ProxyLayerServices";
|
||||
|
||||
@@ -312,7 +319,7 @@
|
||||
const onSetup = () => {
|
||||
if (!global.ipcRenderer) {
|
||||
// @ts-ignore
|
||||
global.ipcRenderer = require("electron").global.ipcRenderer;
|
||||
global.ipcRenderer = require("electron").ipcRenderer;
|
||||
}
|
||||
|
||||
initPlsConnection();
|
||||
|
||||
16
src/aura/ui/pages/windows/auraWsKeepAlive/index.html
Normal file
16
src/aura/ui/pages/windows/auraWsKeepAlive/index.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Aura WebSocket KeepAlive Window</title>
|
||||
<style>
|
||||
:root {
|
||||
opacity: 0;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
let global = window;
|
||||
</script>
|
||||
<script src="../../../js/plsConnectionManager.js"></script>
|
||||
</head>
|
||||
<body></body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user