move intercept_state and extra_headers from CDP instance to BrowserContext

This commit is contained in:
Karl Seguin
2025-08-18 13:23:17 +08:00
parent c1319d1f27
commit 211012d367
4 changed files with 57 additions and 22 deletions

View File

@@ -409,8 +409,9 @@ fn doAttachtoTarget(cmd: anytype, target_id: []const u8) !void {
std.debug.assert(bc.session_id == null);
const session_id = cmd.cdp.session_id_gen.next();
// extra_headers should not be kept on a new page or tab, currently we have only 1 page, we clear it just in case
bc.cdp.extra_headers.clearRetainingCapacity();
// extra_headers should not be kept on a new page or tab,
// currently we have only 1 page, we clear it just in case
bc.extra_headers.clearRetainingCapacity();
try cmd.sendEvent("Target.attachedToTarget", AttachToTarget{
.sessionId = session_id,