mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-22 20:54:43 +00:00
dispatch .page_navigated event on page error callback
When a CDP client navigates to a page and the page generates an error, it blocks waiting for the .page_navigated event. It currently happens w/ robots.txt denied page. Example: https://httpbin.io/deny
This commit is contained in:
@@ -799,6 +799,14 @@ fn pageErrorCallback(ctx: *anyopaque, err: anyerror) void {
|
|||||||
var self: *Page = @ptrCast(@alignCast(ctx));
|
var self: *Page = @ptrCast(@alignCast(ctx));
|
||||||
self.clearTransferArena();
|
self.clearTransferArena();
|
||||||
self._parse_state = .{ .err = err };
|
self._parse_state = .{ .err = err };
|
||||||
|
|
||||||
|
// Dispatch a navigated event to indicate the end of the navigation.
|
||||||
|
self._session.notification.dispatch(.page_navigated, &.{
|
||||||
|
.req_id = self._req_id.?,
|
||||||
|
.opts = self._navigated_options.?,
|
||||||
|
.url = self.url,
|
||||||
|
.timestamp = timestamp(.monotonic),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// The transfer arena is useful and interesting, but has a weird lifetime.
|
// The transfer arena is useful and interesting, but has a weird lifetime.
|
||||||
|
|||||||
Reference in New Issue
Block a user