mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-22 12:44:43 +00:00
Rework CDP frameIds (and loaderIds and requestIds and interceptorIds)
Our BrowsingContext currently supports 1 target. So we have a per-BC target_id. Previously, our target had 1 "frame" - our page. So we often treated the targetId as the frameId. But to work with frames, we need page-specific frameIds and loaderIds. This tries to clean up our ids (a little). frameIds are now ids derived from a new incrementing page.id. This page.id has to be passed around (via http Requests and through notifications) in order to properly generate messages with a frameId.
This commit is contained in:
@@ -92,7 +92,7 @@ const TestContext = struct {
|
||||
|
||||
const BrowserContextOpts = struct {
|
||||
id: ?[]const u8 = null,
|
||||
target_id: ?[]const u8 = null,
|
||||
target_id: ?[14]u8 = null,
|
||||
session_id: ?[]const u8 = null,
|
||||
url: ?[:0]const u8 = null,
|
||||
};
|
||||
@@ -122,7 +122,7 @@ const TestContext = struct {
|
||||
bc.session_id = "SID-X";
|
||||
}
|
||||
if (bc.target_id == null) {
|
||||
bc.target_id = "TID-X";
|
||||
bc.target_id = "TID-000000000Z".*;
|
||||
}
|
||||
const page = try bc.session.createPage();
|
||||
const full_url = try std.fmt.allocPrintSentinel(
|
||||
|
||||
Reference in New Issue
Block a user