MediaWiki:Mobile.js: Difference between revisions

13 bytes added ,  15:00, 26 October 2023
no edit summary
No edit summary
No edit summary
Line 2: Line 2:
$( function(){
$( function(){
if (window.matchMedia("(max-width: 768px)").matches && mw.config.get("skin") !== "minerva" ) {
if (window.matchMedia("(max-width: 768px)").matches) {
const currWikiUrl = new URL(window.location.href);
if( mw.config.get("skin") !== "minerva" ){
currWikiUrl.searchParams.set('useskin', 'minerva');
const currWikiUrl = new URL(window.location.href);
currWikiUrl.searchParams.set('useskin', 'minerva');
window.location.replace(currWikiUrl);
window.location.replace(currWikiUrl);
}
} else {
} else {
if(  mw.config.get("skin") !== "vector" ){
if(  mw.config.get("skin") !== "vector" ){