mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-01-23 02:36:05 +00:00
fix: use contextBridge for Electron API exposure with context isolation
Replace direct window.ea assignment with contextBridge.exposeInMainWorld() to properly expose the Electron API when contextIsolation is enabled. This resolves the "window.ea is not available" error.
This commit is contained in:
parent
2fcd310ea1
commit
d2eecb49ec
1 changed files with 3 additions and 3 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { ipcRenderer, IpcRendererEvent, webFrame } from 'electron';
|
||||
import { ipcRenderer, IpcRendererEvent, webFrame, contextBridge } from 'electron';
|
||||
import { ElectronAPI } from './electronAPI.d';
|
||||
import { IPCEventValue } from './shared-with-frontend/ipc-events.const';
|
||||
import { LocalBackupMeta } from '../src/app/imex/local-backup/local-backup.model';
|
||||
|
|
@ -125,5 +125,5 @@ const ea: ElectronAPI = {
|
|||
) as Promise<PluginNodeScriptResult>,
|
||||
};
|
||||
|
||||
// Expose ea to window for ipc-event.ts
|
||||
(window as any).ea = ea;
|
||||
// Expose ea to window for ipc-event.ts using contextBridge for context isolation
|
||||
contextBridge.exposeInMainWorld('ea', ea);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue