MediaWiki:Gadget-site-T302627.js

/** * Investigate and quantify https://phabricator.wikimedia.org/T302627 * * @source https://www.mediawiki.org/wiki/MediaWiki:Gadget-site-T302627.js * @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 validSkins = ['vector', 'vector-2022', 'monobook', 'minerva', 'timeless'];	var param = mw.util.getParamValue('useskin');	if (param && validSkins.indexOf(param) === -1) {		// invalid value results in default skin which may be vector-2022		param = 'vector-2022';	}	if (validSkins.indexOf(pref) === -1) {		// empty string or other corruption in user options which show default of vector-2022		pref = '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'); }	});