mirror of
https://github.com/viarotel-org/escrcpy.git
synced 2024-12-21 03:45:58 +01:00
16 lines
281 B
JavaScript
16 lines
281 B
JavaScript
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
|
|
}
|
|
}
|