From 9bfa4ac107186a3b173ce2ff8e0ad169a7a8839c Mon Sep 17 00:00:00 2001 From: yu <1919727607@qq.com> Date: Tue, 3 Nov 2026 13:57:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20overlay=E6=94=B9loadFile(=E4=B8=8D?= =?UTF-8?q?=E7=94=A8data=20URL)=20+=20nodeIntegration=E5=BC=80=E5=90=AF=20?= =?UTF-8?q?+=20taskbar=E8=BF=9B=E5=BA=A6=E6=9D=A1=E5=85=9C=E5=BA=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/overlay.ts | 158 ++++++++++++++++++++++++-------------------- 1 file changed, 88 insertions(+), 70 deletions(-) diff --git a/src/main/overlay.ts b/src/main/overlay.ts index c29d094..0a14bf0 100644 --- a/src/main/overlay.ts +++ b/src/main/overlay.ts @@ -1,9 +1,83 @@ import { BrowserWindow, ipcMain, screen } from "electron"; +import fs from "node:fs"; +import path from "node:path"; +import { app } from "electron"; let overlayWindow: BrowserWindow | null = null; +function writeOverlayHtml(): string { + const dir = path.join(app.getPath("temp"), "rpa-studio-overlay"); + fs.mkdirSync(dir, { recursive: true }); + const file = path.join(dir, "overlay.html"); + const html = ` + +
+
+
准备运行…
+
+
+
0/0
+ + +`; + fs.writeFileSync(file, html, "utf8"); + return file; +} + export function showRunOverlay(mainWindow: BrowserWindow | null): void { - if (mainWindow && !mainWindow.isDestroyed()) mainWindow.minimize(); + if (mainWindow && !mainWindow.isDestroyed()) { + mainWindow.minimize(); + mainWindow.setProgressBar(0); + } if (overlayWindow && !overlayWindow.isDestroyed()) { overlayWindow.show(); @@ -30,9 +104,7 @@ export function showRunOverlay(mainWindow: BrowserWindow | null): void { skipTaskbar: true, alwaysOnTop: true, fullscreenable: false, - enableLargerThanScreen: false, hasShadow: true, - transparent: false, backgroundColor: "#1E2530", webPreferences: { contextIsolation: false, @@ -41,73 +113,16 @@ export function showRunOverlay(mainWindow: BrowserWindow | null): void { } }); overlayWindow.setAlwaysOnTop(true, "screen-saver"); - - const html = ` - -
-
-
\u51C6\u5907\u8FD0\u884C\u2026
-
-
-
0/0
- -