MCPcopy
hub / github.com/modstart-lib/aigcpanel / exposeContext

Function exposeContext

electron/mapi/util.ts:3–13  ·  view source on GitHub ↗
(key, value)

Source from the content-addressed store, hash-verified

1import { contextBridge } from "electron";
2
3export function exposeContext(key, value) {
4 if (process.contextIsolated) {
5 try {
6 contextBridge.exposeInMainWorld(key, value);
7 } catch (error) {
8 console.error(error);
9 }
10 } else {
11 window[key] = value;
12 }
13}

Callers 1

initFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected