File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,12 @@ index: usize = 0,
4747entries : std .ArrayListUnmanaged (* NavigationHistoryEntry ) = .empty ,
4848next_entry_id : usize = 0 ,
4949
50+ pub fn resetForNewPage (self : * Navigation ) void {
51+ // libdom will automatically clean this up when a new page is made.
52+ // We must create a new target whenever we create a new page.
53+ self .proto = NavigationEventTarget {};
54+ }
55+
5056pub fn get_canGoBack (self : * const Navigation ) bool {
5157 return self .index > 0 ;
5258}
Original file line number Diff line number Diff line change @@ -104,6 +104,9 @@ pub const Session = struct {
104104 // We need to init this early as JS event handlers may be registered through Runtime.evaluate before the first html doc is loaded
105105 parser .init ();
106106
107+ // creates a new event target for Navigation
108+ self .navigation .resetForNewPage ();
109+
107110 const page_arena = & self .browser .page_arena ;
108111 _ = page_arena .reset (.{ .retain_with_limit = 1 * 1024 * 1024 });
109112 _ = self .browser .state_pool .reset (.{ .retain_with_limit = 4 * 1024 });
You can’t perform that action at this time.
0 commit comments