Add fulfillRequest and more complete continueRequest

This commit is contained in:
Karl Seguin
2025-08-18 18:29:10 +08:00
parent 211012d367
commit f5ec74252d
10 changed files with 231 additions and 96 deletions

View File

@@ -387,6 +387,12 @@ pub fn BrowserContext(comptime CDP_T: type) type {
pub fn deinit(self: *Self) void {
self.inspector.deinit();
// abort all intercepted requests before closing the sesion/page
// since some of these might callback into the page/scriptmanager
for (self.intercept_state.pendingTransfers()) |transfer| {
transfer.abort();
}
// If the session has a page, we need to clear it first. The page
// context is always nested inside of the isolated world context,
// so we need to shutdown the page one first.
@@ -406,10 +412,6 @@ pub fn BrowserContext(comptime CDP_T: type) type {
log.warn(.http, "restoreOriginalProxy", .{ .err = err });
};
}
for (self.intercept_state.pendingTransfers()) |transfer| {
transfer.abort();
}
self.intercept_state.deinit();
}