Files
morluto 8f229ede70 feat(electron): add autonomous Electron runtime analysis (#464)
* feat: add autonomous Electron runtime analysis

* feat(electron): add lifecycle and boundary telemetry

* feat(electron): capture runtime boundary evidence

* fix(electron): package boundary hook helper

* feat(electron): report active capture coverage

* fix(electron): account for bring-your-own runtime

* feat(electron): expand agent-owned runtime scenarios

* fix(ghidra): keep fixture credentials out of argv

* perf(test): serialize local test and docs workloads

* fix(electron): harden active runtime capture

* fix(inspector): require exact runtime target authorization

* fix(docs): make managed manifest host independent

* fix(ci): make generated catalog portable

* fix: unblock autonomous command and electron flows

* fix(electron): close popup and detached helper gaps
2026-08-05 19:07:46 +08:00

37 lines
1.1 KiB
JavaScript

const {
app,
BrowserWindow,
ipcMain,
shell,
utilityProcess,
} = require("electron");
const { spawn } = require("node:child_process");
const windows = new Set();
const deliverDeepLink = (url) => {
for (const window of windows) window.webContents.send("deep-link", url);
};
app.on("open-url", (_event, url) => deliverDeepLink(url));
app.on("second-instance", (_event, commandLine) => {
const url = commandLine.at(-1);
if (typeof url === "string") deliverDeepLink(url);
});
app.whenReady().then(() => {
for (let index = 0; index < 2; index += 1) {
const window = new BrowserWindow({
webPreferences: { preload: require.resolve("./preload.js") },
});
windows.add(window);
window.loadFile("renderer.html");
window.webContents.on("render-process-gone", () => window.reload());
}
utilityProcess.fork(require.resolve("./utility.js"));
spawn(
process.env.REA_ELECTRON_NODE_EXECUTABLE ?? "node",
["-e", "setTimeout(() => {}, 100)"],
{ stdio: "ignore" },
);
ipcMain.handle("readiness:echo", (_event, value) => ({ value }));
shell.openExternal("https://blocked.invalid").catch(() => undefined);
});