mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-06-11 09:35:59 -04:00
keep the existing page active until the pending one is loaded
During a root navigation, we keep the existing page active until we get the headers callback from the pending page. Then Session.commitPendingPage makes the switch. It delays the deinit of CPD execution context to handle JS execution in the meantime. Now session has an array of two pages, _active_idx points to the main page. Both active and pending pages share the same frame_id, it must remains stable. So this PR adds a Request.protect_from_abort to avoid removing the request form the pending page when deinit the previous active page.
This commit is contained in:
@@ -118,6 +118,11 @@ pub const FrameNavigate = struct {
|
||||
timestamp: u64,
|
||||
url: [:0]const u8,
|
||||
opts: Frame.NavigateOpts,
|
||||
// True when this navigation is being issued against a Page that is in
|
||||
// .pending state (i.e. an in-flight root navigation whose old Page is
|
||||
// still alive). CDP uses this to skip BrowserContext.reset() — the old
|
||||
// page's nodes must remain live and addressable until commit.
|
||||
is_pending_root: bool = false,
|
||||
};
|
||||
|
||||
pub const FrameNavigated = struct {
|
||||
|
||||
Reference in New Issue
Block a user