@@ -82,14 +82,15 @@ export class History {
8282
8383 push (
8484 url : URL ,
85+ title : string | null = null ,
8586 state : any = null ,
8687 navigate : boolean = true ,
8788 virtual : boolean = false
8889 ) : HistoryState {
8990 if ( this . index + 1 < this . states . length )
9091 // "fork" history tree, creating a new timeline
9192 this . states . splice ( this . index , this . states . length - this . index ) ;
92- const hstate = new HistoryState ( { url, state } ) ;
93+ const hstate = new HistoryState ( { url, state, title } ) ;
9394 if ( virtual ) hstate . virtual = true ;
9495
9596 if ( url . href != "puter://newtab" ) browser . globalhistory . push ( hstate ) ;
@@ -106,11 +107,16 @@ export class History {
106107
107108 return this . states [ this . index ] ;
108109 }
109- replace ( url : URL , state : any , navigate : boolean = true ) : HistoryState {
110+ replace (
111+ url : URL ,
112+ title : string | null ,
113+ state : any ,
114+ navigate : boolean = true
115+ ) : HistoryState {
110116 if ( this . index < this . states . length ) {
111117 this . current ( ) . url = url ;
112118 this . current ( ) . state = state ;
113- this . current ( ) . title = null ;
119+ this . current ( ) . title = title ;
114120 this . current ( ) . favicon = null ;
115121 } else {
116122 return this . push ( url , state ) ;
@@ -127,6 +133,7 @@ export class History {
127133 return this . states [ this . index ] ;
128134 }
129135 go ( delta : number , navigate : boolean = true ) : HistoryState {
136+ const current = this . current ( ) ;
130137 this . index += delta ;
131138 if ( this . index < 0 ) {
132139 this . index = 0 ;
@@ -135,8 +142,9 @@ export class History {
135142 }
136143
137144 let newstate = this . states [ this . index ] ;
145+ console . error ( "going" , newstate ) ;
138146
139- if ( newstate . virtual ) {
147+ if ( current . virtual ) {
140148 sendFrame ( this . tab , "popstate" , {
141149 state : newstate . state ,
142150 url : newstate . url . href ,
0 commit comments