escrcpy/electron/helpers/index.js

16 lines
281 B
JavaScript
Raw Normal View History

import { contextBridge } from 'electron'
export function exposeContext(key, value) {
if (process.contextIsolated) {
try {
contextBridge.exposeInMainWorld(key, value)
}
catch (error) {
console.error(error)
}
}
else {
window[key] = value
}
}