MediaWiki:Common.js: Difference between revisions

Content deleted Content added
m convert spacing to tabs
replace deprecated mw.Uri with native URL - phab:T374314
Line 10:
// we are gonna have a bad time as geolocation doesn't happen. Do a redirect to send them round again
try {
var uriurl = new mw.UriURL( window.location.href );
if (
if ( uri.query.title === 'Special:LandingPage' && uri.query.country === undefined && uri.query.retried === undefined ) {
url.searchParams.get( 'title' ) === 'Special:LandingPage' &&
url.searchParams.get( 'country' ) === null &&
url.searchParams.get( 'retried' ) === null
) {
console.log( 'redirecting to pick up country parameter' );
uriurl.pathpathname = '/';
uriurl.querysearchParams.set( 'retried =', 1 ); // only do this once
delete uriurl.querysearchParams.delete( 'title' );
window.location.href = uriurl.toString();
}
} catch (error) {