Skip to content

Commit 1b1b7cd

Browse files
Add page_life_cycle_events in CDP state
Signed-off-by: Francis Bouvier <[email protected]>
1 parent 9e13ffb commit 1b1b7cd

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/cdp/cdp.zig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ pub const State = struct {
7777
securityOrigin: []const u8 = URLBase,
7878
secureContextType: []const u8 = "Secure", // TODO: enum
7979
loaderID: []const u8 = LoaderID,
80+
81+
page_life_cycle_events: bool = false, // TODO; Target based value
8082
};
8183

8284
// Utils

src/cdp/page.zig

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ fn setLifecycleEventsEnabled(
8989
alloc: std.mem.Allocator,
9090
id: u64,
9191
scanner: *std.json.Scanner,
92-
_: *Ctx,
92+
ctx: *Ctx,
9393
) ![]const u8 {
9494

9595
// input
@@ -99,8 +99,9 @@ fn setLifecycleEventsEnabled(
9999
_ = try getParams(alloc, Params, scanner);
100100
const sessionID = try cdp.getSessionID(scanner);
101101

102+
ctx.state.page_life_cycle_events = true;
103+
102104
// output
103-
// TODO: dummy
104105
return result(alloc, id, null, null, sessionID);
105106
}
106107

0 commit comments

Comments
 (0)