mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-07 07:42:13 +03:00
[v3.8.50] feat(electron): add Remote Server Mode to attach to an external OmniRoute instance (#8799)
Validated in local merge-train T7 (ungrouped batch 2)
This commit is contained in:
15
electron/remoteServerPromptPreload.js
Normal file
15
electron/remoteServerPromptPreload.js
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Preload for the small "Connect to Remote Server" prompt window.
|
||||
*
|
||||
* Kept separate from the main preload.js — this window only ever loads our
|
||||
* own bundled remoteServerPrompt.html (never remote/untrusted content), but we
|
||||
* still keep contextIsolation on and expose the minimum surface needed.
|
||||
*/
|
||||
|
||||
const { contextBridge, ipcRenderer } = require("electron");
|
||||
|
||||
contextBridge.exposeInMainWorld("remoteServerPrompt", {
|
||||
getInitialUrl: () => ipcRenderer.invoke("remote-server-prompt:get-initial-url"),
|
||||
submit: (url) => ipcRenderer.send("remote-server-prompt:submit", url),
|
||||
cancel: () => ipcRenderer.send("remote-server-prompt:cancel"),
|
||||
});
|
||||
Reference in New Issue
Block a user