mirror of
https://github.com/morluto/rea.git
synced 2026-11-11 01:13:39 +00:00
Read screenshot identity from the selected frame-tree root instead of a filtered inventory that could substitute a child. Reuse the frame record parser for initial and event identities, rejecting malformed roots before capture while preserving known origin refusals. Share explicit origin-scope diagnostics across CDP workflows without changing policy or conflating startup uncertainty, document replacement, worker protection, and Inspector restrictions. Document the recovery and make screenshot navigation fixture ordering explicit. Validation: 577 focused checks passed across 13 files; one platform-specific invalid-byte-filename case skipped. Build, typecheck, lint, formatting, generated documentation checks, README conformance, and discovery passed. No full suite or live browser/provider execution.
17 lines
783 B
TypeScript
17 lines
783 B
TypeScript
import { BrowserObservationError } from "../domain/browserObservationError.js";
|
|
import type { BrowserObservationOperation } from "../domain/browserObservationErrors.js";
|
|
|
|
/** Use only after a CDP document is known to be outside its HTTP(S) scope. */
|
|
export const cdpOriginScopeRefusal = (
|
|
operation: BrowserObservationOperation,
|
|
options?: { readonly cause?: unknown; readonly detail?: string },
|
|
): BrowserObservationError =>
|
|
new BrowserObservationError(operation, "target_not_allowed", {
|
|
...options,
|
|
detail:
|
|
options?.detail ??
|
|
"The current document is outside the permitted HTTP(S) origin scope.",
|
|
remediationAction:
|
|
"Select a document within allowed_origins, or explicitly adjust allowed_origins if that document is intended, then retry.",
|
|
});
|