A request from the performance team to help spearhead their efforts in a performance initiative.
As part of the performance effort to dismantle the targets system (T127268), we should set targets to mobile and desktop for Popups module ext.popups using the following pattern:
if ( ExtensionRegistry::isLoaded( 'MobileFrontend' ) ) { $ctx = MediaWikiServices::getInstance()->getService( 'MobileFrontend.Context' ); if ( !$ctx->shouldDisplayMobileView() ) { $out->addModule('ext.popups') } } else { // MobileFrontend is not installed. $out->addModule('ext.popups') }
Acceptance criteria
- Add the mobile target to ext.popups module
- Make sure the module doesn't load on the mobile domain.
QA steps
- Visit https://en.wikipedia.beta.wmflabs.org/wiki/Christopher_Nixon_Cox#/random on a desktop browser. Confirm that hovering over "President of the United States" shows a very badly formatted Popup (don't worry about its contents). If it doesn't check your preferences/the footer to ensure Popups is enabled and try again.
- Visit https://en.wikipedia.beta.wmflabs.org/wiki/Christopher_Nixon_Cox#/random on a mobile browser (if redirected click "desktop view" at the bottom. Confirm that it's not possible to show a page preview when you hover over "President of the United States"
- Visit https://en.m.wikipedia.beta.wmflabs.org/wiki/Christopher_Nixon_Cox#/random on a desktop browser. Confirm that hovering over "President of the United States" shows a very badly formatted Popup (don't worry about its contents)
- Visit https://en.m.wikipedia.beta.wmflabs.org/wiki/Christopher_Nixon_Cox#/random on a mobile browser. Confirm that it's not possible to show a page preview when you hover over "President of the United States"
QA Results - Beta
AC | Status | Details |
---|---|---|
1 | ✅ | T236097#6045544 |
2 | ✅ | T236097#6045544 |
3 | ✅ | T236097#6045544 |
4 | ✅ | T236097#6045544 |
QA Results - Prod
AC | Status | Details |
---|---|---|
1 | ✅ | T236097#6045546 |
2 | ✅ | T236097#6045546 |
3 | ✅ | T236097#6045546 |
4 | ✅ | T236097#6045546 |