mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-09-24 18:44:54 +02:00
[eric] windows: fix UA-spoof leak onto recreated main window + add diag logs across preload, createWindow, recreateMainWindow, resumeSession, launchAndSendFirstMessage, AgentChat, WebSocketManager so packaged-build stderr captures the chat-spawn crash trail
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
const { contextBridge, ipcRenderer } = require('electron');
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('[diag][preload] start, ua=', navigator.userAgent);
|
||||
|
||||
// Synchronous exposure. The previous async IIFE (await ipcRenderer.invoke) raced React mount: any code reading window.openswarm during the gap (BrowserCard's Electron-detection falling back to iframe mode, AgentChat's auth-token call throwing) saw undefined. sendSync blocks the renderer for one IPC round-trip during preload before any user-visible paint, so window.openswarm is guaranteed to exist before the first frontend bundle evaluates.
|
||||
const port = ipcRenderer.sendSync('get-backend-port-sync');
|
||||
const webviewPreloadPath = ipcRenderer.sendSync('get-webview-preload-path-sync');
|
||||
|
||||
Reference in New Issue
Block a user