源码快照 @ 2026-09-02 (source-only, 剔除非源码素材)

This commit is contained in:
agent-radar
2026-09-02 01:05:41 +08:00
commit 04bac1f6e2
2200 changed files with 489415 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
import { evalIn } from "@openwork/behaviors";
import type { Surface } from "@openwork/cdp";
export interface InPageOptions {
awaitPromise?: boolean;
timeoutMs?: number;
}
/** Execute function source in the page with one JSON-serialized argument. */
export function inPage(
surface: Surface,
fnSource: string,
args: unknown,
options: InPageOptions = {},
): Promise<unknown> {
const injected = JSON.stringify(args);
if (injected === undefined) throw new Error("inPage arguments must be JSON-serializable.");
return evalIn(surface, `(${fnSource})(${injected})`, options);
}