Chrome does not revert title to article title

The issue seems to be related with the chronology of the document.title
update and the history.pushState/replaceState call.

Bug: T225387
Change-Id: Ifcd11d5efb3ba64d88b137eccb4b9c763d043004
This commit is contained in:
Simon Legner 2019-06-11 11:50:44 +02:00
parent f89d7dc878
commit a663d2884c

View file

@ -882,13 +882,13 @@
this.viewLogger.recordViewDuration();
this.viewLogger.unattach();
document.title = this.createDocumentTitle( null );
if ( comingFromHashChange ) {
comingFromHashChange = false;
} else {
this.router.back();
}
// update title after route change, see T225387
document.title = this.createDocumentTitle( null );
// This has to happen after the hash reset, because setting the hash to # will reset the page scroll
$( document ).trigger( $.Event( 'mmv-cleanup-overlay' ) );
@ -942,11 +942,12 @@
comingFromHashChange = false;
return;
}
document.title = this.createDocumentTitle( this.currentImageFileTitle );
this.router.navigateTo( document.title, {
path: mw.mmv.getMediaHash( this.currentImageFileTitle ),
useReplaceState: useReplaceState
} );
// update title after route change, see T225387
document.title = this.createDocumentTitle( this.currentImageFileTitle );
};
/**