-
-
Notifications
You must be signed in to change notification settings - Fork 187
/
Copy pathindex.ts
19 lines (14 loc) · 796 Bytes
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// This file is used to securely expose Electron APIs to the application.
import { validateRuntimeSanity } from '@/infrastructure/RuntimeSanity/SanityChecks';
import { ElectronLogger } from '@/infrastructure/Log/ElectronLogger';
import { connectApisWithContextBridge } from './ContextBridging/ApiContextBridge';
validateRuntimeSanity({
// Validate metadata as a preventive measure for fail-fast,
// even if it's not currently used in the preload script.
validateEnvironmentVariables: true,
// The preload script cannot access variables on the window object.
validateWindowVariables: false,
});
connectApisWithContextBridge();
// Do not remove [PRELOAD_INIT]; it's a marker used in tests.
ElectronLogger.info('[PRELOAD_INIT] Preload script successfully initialized and executed.');