MediaWiki:Gadget-site-T302627.js

/** * Investigate and quantify https://phabricator.wikimedia.org/T302627 * * @author Krinkle */ $.when($.ready, mw.loader.using(['mediawiki.util'])).then(function {	if (!mw.config.get('wgUserName')) {		return;	}	var pref = mw.user.options.get('skin');	var validParam = ['vector', 'vector-2022', 'monobook', 'minerva', 'timeless'];	var param = mw.util.getParamValue('useskin');	if (param && validParam.indexOf(param) === -1) {		// invalid value results in default skin which may be vector-2022		param = 'vector-2022';	}

var expectsNewVector = (pref === 'vector-2022') || (param === 'vector-2022'); var isShowingNewVector = !!( document.querySelector('#mw-sidebar-button') && document.querySelector('.mw-workspace-container .mw-sidebar-action-content') && document.querySelector('.mw-ui-icon-wikimedia-userAvatar') );

if (!expectsNewVector && isShowingNewVector) { mw.track('counter.MediaWiki.vector_bug_T302627.unexpected_vector22'); if ( mw.config.get('skin') === 'vector-2022' ) { mw.track('counter.MediaWiki.vector_bug_T302627.unexpected_vector22_pref-conf-mismatch'); }	}	});