Files
37duAutomation/desktop/electron-shell/electron/preload.js
T

15 lines
500 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// preload:contextBridge 白名单 IPC(渲染层主通道走 HTTP 兼容层,此处仅暴露只读环境信息)。
"use strict";
const { contextBridge } = require("electron");
contextBridge.exposeInMainWorld("dshShell", {
platform: process.platform,
versions: {
electron: process.versions.electron,
node: process.versions.node,
chrome: process.versions.chrome,
},
// 渲染层可通过 window.open 打开中心机控制面(外部 URL 需在渲染层显式触发)
});