diff --git a/src/main/overlay.ts b/src/main/overlay.ts index f021e24..c29d094 100644 --- a/src/main/overlay.ts +++ b/src/main/overlay.ts @@ -1,8 +1,6 @@ -import { BrowserWindow, ipcMain } from "electron"; -import path from "node:path"; +import { BrowserWindow, ipcMain, screen } from "electron"; let overlayWindow: BrowserWindow | null = null; -let cachedProgress = { current: "", done: 0, total: 0 }; export function showRunOverlay(mainWindow: BrowserWindow | null): void { if (mainWindow && !mainWindow.isDestroyed()) mainWindow.minimize(); @@ -14,9 +12,6 @@ export function showRunOverlay(mainWindow: BrowserWindow | null): void { const w = 320; const h = 56; - const { - screen - } = require("electron") as typeof import("electron"); const workArea = screen.getPrimaryDisplay().workArea; const x = workArea.x + workArea.width - w - 16; const y = workArea.y + workArea.height - h - 16; @@ -40,9 +35,8 @@ export function showRunOverlay(mainWindow: BrowserWindow | null): void { transparent: false, backgroundColor: "#1E2530", webPreferences: { - preload: path.join(__dirname, "../preload/index.js"), - contextIsolation: true, - nodeIntegration: false, + contextIsolation: false, + nodeIntegration: true, sandbox: false } }); @@ -64,34 +58,33 @@ body{width:320px;height:56px;background:#1E2530;color:#E8ECF2;font-family:-apple
-
准备运行…
+
\u51C6\u5907\u8FD0\u884C\u2026
0/0
- +