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 userSkin = mw.user.options.get('skin');	if (userSkin !== 'vector' && userSkin !== 'vector-2022') {		// User is using another skin e.g. Timeless or Monobook.		return;	}

var expectsNewVector = (userSkin === 'vector-2022') || (mw.util.getParamValue('useskin') === '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') );

var variant = 'unknown'; if (expectsNewVector && isShowingNewVector) { variant = 'expected_vector22'; }	if (!expectsNewVector && !isShowingNewVector) { variant = 'expected_vector19'; }	if (expectsNewVector && !isShowingNewVector) { variant = 'unexpected_vector19'; }	if (!expectsNewVector && isShowingNewVector) { variant = 'unexpected_vector22'; }

mw.track('counter.MediaWiki.vector_bug_T302627.' + variant); });