Remove CDP FrameId

I don't know if FrameId is related to an <iframe>, and whether each Page has
1 implicit "frame". But, playwright seems to treat frameId and targetId as
interchangeable, and chrome seems to agree (at leas to some degree); chrome will
return a targetId and reuse that value for the frameId.

So the simplest solution is just to remove our concept of a frameId and use
targetId exclusively. This doesn't seem to cause any issues with puppeteer.
This commit is contained in:
Karl Seguin
2025-03-11 10:37:43 +08:00
parent 763d8d025e
commit 5182edce6f
4 changed files with 17 additions and 18 deletions

View File

@@ -28,7 +28,6 @@ const log = std.log.scoped(.cdp);
pub const URL_BASE = "chrome://newtab/";
pub const LOADER_ID = "LOADERID24DD2FD56CF1EF33C965C79C";
pub const FRAME_ID = "FRAMEIDD8AED408A0467AC93100BCDBE";
pub const TimestampEvent = struct {
timestamp: f64,
@@ -282,7 +281,6 @@ pub fn BrowserContext(comptime CDP_T: type) type {
// State
url: []const u8,
frame_id: []const u8,
loader_id: []const u8,
security_origin: []const u8,
page_life_cycle_events: bool,
@@ -301,7 +299,6 @@ pub fn BrowserContext(comptime CDP_T: type) type {
.target_id = null,
.session_id = null,
.url = URL_BASE,
.frame_id = FRAME_ID,
.security_origin = URL_BASE,
.secure_context_type = "Secure", // TODO = enum
.loader_id = LOADER_ID,