mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-22 12:44:43 +00:00
Rename page.id to page._frame_id
This field was recently added and is used to generate correct frameIds in CDP messages. They remain the same during a navigation event, so calling them page.id might cause surprises since navigation events create new pages, but retain the original id. Hence, frame_id is more accurate and hopefully less surprising. (This is a small cleanup prior to doing some iframe navigation work).
This commit is contained in:
@@ -177,7 +177,7 @@ fn createTarget(cmd: anytype) !void {
|
||||
const page = try bc.session.createPage();
|
||||
|
||||
// the target_id == the frame_id of the "root" page
|
||||
const frame_id = id.toFrameId(page.id);
|
||||
const frame_id = id.toFrameId(page._frame_id);
|
||||
bc.target_id = frame_id;
|
||||
const target_id = &bc.target_id.?;
|
||||
{
|
||||
@@ -421,7 +421,7 @@ fn setAutoAttach(cmd: anytype) !void {
|
||||
if (bc.target_id == null) {
|
||||
if (bc.session.currentPage()) |page| {
|
||||
// the target_id == the frame_id of the "root" page
|
||||
bc.target_id = id.toFrameId(page.id);
|
||||
bc.target_id = id.toFrameId(page._frame_id);
|
||||
try doAttachtoTarget(cmd, &bc.target_id.?);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user