mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-28 22:53:28 +00:00
cdp: dispatch Page.frameNavigated before DOM.documentUpdated
chromedp client expects to receive Page.frameNavigated before DOM.documentUpdated.
This commit is contained in:
@@ -243,8 +243,6 @@ pub fn pageNavigated(bc: anytype, event: *const Notification.PageNavigated) !voi
|
||||
const target_id = bc.target_id orelse unreachable;
|
||||
const session_id = bc.session_id orelse unreachable;
|
||||
|
||||
try cdp.sendEvent("DOM.documentUpdated", null, .{ .session_id = session_id });
|
||||
|
||||
// frameNavigated event
|
||||
try cdp.sendEvent("Page.frameNavigated", .{
|
||||
.type = "Navigation",
|
||||
@@ -257,6 +255,11 @@ pub fn pageNavigated(bc: anytype, event: *const Notification.PageNavigated) !voi
|
||||
},
|
||||
}, .{ .session_id = session_id });
|
||||
|
||||
// The DOM.documentUpdated event must be send after the frameNavigated one.
|
||||
// chromedp client expects to receive the events is this order.
|
||||
// see https://github.com/chromedp/chromedp/issues/1558
|
||||
try cdp.sendEvent("DOM.documentUpdated", null, .{ .session_id = session_id });
|
||||
|
||||
// domContentEventFired event
|
||||
// TODO: partially hard coded
|
||||
try cdp.sendEvent(
|
||||
|
||||
Reference in New Issue
Block a user