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 expectsNewVector = (mw.user.options.get('skin') === '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); });