feat(desktop): support remote runtime headers
This commit is contained in:
@@ -14,6 +14,7 @@ const readArgValue = (name) => {
|
||||
const localOrigin = readArgValue('--openchamber-local-origin');
|
||||
const apiBaseUrl = readArgValue('--openchamber-api-base-url');
|
||||
const clientToken = readArgValue('--openchamber-client-token');
|
||||
const runtimeHeadersRaw = readArgValue('--openchamber-runtime-headers');
|
||||
const homeDirectory = readArgValue('--openchamber-home');
|
||||
const macosMajorRaw = readArgValue('--openchamber-macos-major');
|
||||
const macosMajor = Number.parseInt(macosMajorRaw, 10);
|
||||
@@ -61,6 +62,16 @@ if (clientToken && isLocalPage) {
|
||||
contextBridge.exposeInMainWorld('__OPENCHAMBER_CLIENT_TOKEN__', clientToken);
|
||||
}
|
||||
|
||||
if (runtimeHeadersRaw && isLocalPage) {
|
||||
try {
|
||||
const runtimeHeaders = JSON.parse(runtimeHeadersRaw);
|
||||
if (runtimeHeaders && typeof runtimeHeaders === 'object') {
|
||||
contextBridge.exposeInMainWorld('__OPENCHAMBER_RUNTIME_HEADERS__', runtimeHeaders);
|
||||
}
|
||||
} catch {
|
||||
}
|
||||
}
|
||||
|
||||
// Home directory leaks the OS username — keep local-only. Remote pages
|
||||
// operate on the REMOTE server's filesystem, local home is irrelevant
|
||||
// (and would be misleading if consumed as a workspace hint).
|
||||
|
||||
Reference in New Issue
Block a user