feat(ghidra): add private headless provider session

This commit is contained in:
N0zoM1z0
2026-07-16 01:27:54 +09:00
committed by N0zoM1z0
parent ed17e76473
commit f0e625d7ee
234 changed files with 8968 additions and 513 deletions
+14 -1
View File
@@ -9,6 +9,7 @@ import {
BrowserObservationError,
type BrowserObservationOperation,
} from "../domain/errors.js";
import { sanitizeBrowserUrl } from "../domain/browserObservation.js";
const HTTP_TIMEOUT_MS = 5_000;
const MAX_VERSION_BYTES = 64 * 1_024;
@@ -111,7 +112,7 @@ export const discoverCdpEndpoint = async (
targets: targets.map((target) => ({
id: target.id,
type: target.type,
title: target.title,
title: sanitizeTargetTitle(target.title),
url: target.url,
attached: target.attached,
...targetWebSocket(endpoint, target, operation),
@@ -119,6 +120,18 @@ export const discoverCdpEndpoint = async (
};
};
const sanitizeTargetTitle = (value: string): string => {
let url: URL;
try {
url = new URL(value);
} catch {
return value;
}
return url.protocol === "http:" || url.protocol === "https:"
? sanitizeBrowserUrl(value).url.slice(0, 16_384)
: value;
};
/** Select a browser attachment socket or a direct socket for one page target. */
export const cdpTargetWebSocket = (
discovery: CdpEndpointDiscovery,