Merge "Stop adding the 'diffmode' parameter to the URL"

This commit is contained in:
jenkins-bot 2023-04-15 22:28:55 +00:00 committed by Gerrit Code Review
commit a453404bb1

View file

@ -29,14 +29,13 @@
); );
function onReviewModeButtonSelectSelect( item ) { function onReviewModeButtonSelectSelect( item ) {
var url = new URL( location.href );
var oldPageName, newPageName; var oldPageName, newPageName;
if ( mw.config.get( 'wgCanonicalSpecialPageName' ) !== 'ComparePages' ) { if ( mw.config.get( 'wgCanonicalSpecialPageName' ) !== 'ComparePages' ) {
oldPageName = newPageName = mw.config.get( 'wgRelevantPageName' ); oldPageName = newPageName = mw.config.get( 'wgRelevantPageName' );
} else { } else {
oldPageName = url.searchParams.get( 'page1' ); var params = new URLSearchParams( location.search );
newPageName = url.searchParams.get( 'page2' ); oldPageName = params.get( 'page1' );
newPageName = params.get( 'page2' );
} }
var mode = item.getData(); var mode = item.getData();
@ -93,10 +92,6 @@
throw error; throw error;
} ); } );
} }
url.searchParams.set( 'diffmode', mode );
history.replaceState( history.state, '', url );
} }
function onReviewModeButtonSelectChoose( item ) { function onReviewModeButtonSelectChoose( item ) {