Replace uses of mw.Uri with browser native URL
Bug: T374314 Change-Id: I03bfc2618b5b499f9c65832f8af20a7a199e03ec
This commit is contained in:
@@ -326,7 +326,7 @@
|
||||
"mediawiki.api",
|
||||
"mediawiki.jqueryMsg",
|
||||
"@wikimedia/codex",
|
||||
"mediawiki.Uri"
|
||||
"web2017-polyfills"
|
||||
],
|
||||
"messages": [
|
||||
"ext-uls-setlang-error",
|
||||
|
||||
@@ -67,13 +67,13 @@
|
||||
* @return {string}
|
||||
*/
|
||||
function currentUrlWithoutSetLang() {
|
||||
var uri = new mw.Uri();
|
||||
delete uri.query.setlang;
|
||||
return uri.toString();
|
||||
var url = new URL( location.href );
|
||||
url.searchParams.remove( 'setlang' );
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
function removeSetLangFromHistory() {
|
||||
if ( 'setlang' in mw.Uri().query ) {
|
||||
if ( new URL( location.href ).searchParams.has( 'setlang' ) ) {
|
||||
history.replaceState( null, '', currentUrlWithoutSetLang() );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user