mirror of
https://github.com/morluto/rea.git
synced 2026-11-22 22:45:47 +00:00
refactor(browser): parse frame lifecycle events once by a registered event schema (#10730)
* refactor(browser): parse frame lifecycle events once by a registered event schema CdpConnection admits each event through protocol/CdpEvents.ts, which parses the five Page frame lifecycle events once into identity facts plus a frame URL observation, like a frame-tree node. Screenshot, page capture, the observation timeline, WebMCP, Electron inspection and the execution window read those facts instead of re-parsing the raw payload; CdpFrameFacts no longer carries the raw source record. Playwright CDP session subscriptions name an event from Playwright's protocol table, and an architecture guard counts the remaining raw event payload reads so they can only shrink. * refactor(browser): admit transport events through the registered-event owner Remove the unused cdpFrameUrl wrapper; its fragment cases now exercise observeCdpFrameUrl. Add a connection-level test that two subscribers share one parsed payload and the raw params.
This commit is contained in:
1 parent
998faa4118
commit
025d1b365f
32 files changed
+897
-521
No files matched your search
@@ -3,6 +3,7 @@ import { expect, it } from "vitest";
|
||||
import { CdpCaptureEvents } from "./CdpCaptureEvents.js";
|
||||
import { inspectWebPageInputSchema } from "../domain/browserObservation.js";
|
||||
import { webPageInspectionSchema } from "../domain/browserObservationSchemas.js";
|
||||
import { receiveCdpEvent } from "./CdpConnection.js";
|
||||
|
||||
const origin = "http://127.0.0.1:43127";
|
||||
|
||||
@@ -23,7 +24,9 @@ const captureWithConsoleTimestamp = (timestamp: unknown): CdpCaptureEvents => {
|
||||
},
|
||||
};
|
||||
if (timestamp !== undefined) params.timestamp = timestamp;
|
||||
capture.ingest({ method: "Runtime.consoleAPICalled", params });
|
||||
capture.ingest(
|
||||
receiveCdpEvent({ method: "Runtime.consoleAPICalled", params }),
|
||||
);
|
||||
return capture;
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user