mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-12-14 15:28:57 +00:00
cdp: add missing fields to Network.requestWillBeSent
This commit is contained in:
@@ -248,9 +248,12 @@ pub fn httpRequestStart(arena: Allocator, bc: anytype, msg: *const Notification.
|
||||
.requestId = try std.fmt.allocPrint(arena, "REQ-{d}", .{transfer.id}),
|
||||
.frameId = target_id,
|
||||
.loaderId = bc.loader_id,
|
||||
.documentUrl = DocumentUrlWriter.init(&page.url.uri),
|
||||
.type = msg.transfer.req.resource_type.string(),
|
||||
.documentURL = DocumentUrlWriter.init(&page.url.uri),
|
||||
.request = TransferAsRequestWriter.init(transfer),
|
||||
.initiator = .{ .type = "other" },
|
||||
.redirectHasExtraInfo = false, // TODO change after adding Network.requestWillBeSentExtraInfo
|
||||
.hasUserGesture = false,
|
||||
}, .{ .session_id = session_id });
|
||||
}
|
||||
|
||||
@@ -266,6 +269,7 @@ pub fn httpResponseHeaderDone(arena: Allocator, bc: anytype, msg: *const Notific
|
||||
.loaderId = bc.loader_id,
|
||||
.frameId = target_id,
|
||||
.response = TransferAsResponseWriter.init(arena, msg.transfer),
|
||||
.hasExtraInfo = false, // TODO change after adding Network.responseReceivedExtraInfo
|
||||
}, .{ .session_id = session_id });
|
||||
}
|
||||
|
||||
|
||||
@@ -679,6 +679,19 @@ pub const Request = struct {
|
||||
xhr,
|
||||
script,
|
||||
fetch,
|
||||
|
||||
// Allowed Values: Document, Stylesheet, Image, Media, Font, Script,
|
||||
// TextTrack, XHR, Fetch, Prefetch, EventSource, WebSocket, Manifest,
|
||||
// SignedExchange, Ping, CSPViolationReport, Preflight, FedCM, Other
|
||||
// https://chromedevtools.github.io/devtools-protocol/tot/Network/#type-ResourceType
|
||||
pub fn string(self: ResourceType) []const u8 {
|
||||
return switch (self) {
|
||||
.document => "Document",
|
||||
.xhr => "XHR",
|
||||
.script => "Script",
|
||||
.fetch => "Fetch",
|
||||
};
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user