Extension:MobileFrontendContentProvider

The MobileFrontendContentProvider extension allows developers to make MediaWiki ignore the database and use HTTP APIs to access wiki page content. At the time of writing it can only be used for read only views.

MediaWiki extensions manual
MobileFrontendContentProvider
Release status: stable
Description Provides developer tools for testing on the content of a foreign wiki.
Author(s)
MediaWiki 1.33+[1]
PHP 5.5.9+
License GNU General Public License 2.0 or later
Download
Quarterly downloads 0
Translate the MobileFrontendContentProvider extension if it is available at translatewiki.net
Issues Open tasks · Report a bug

Setup

edit

MobileFrontendContentProvider was previously part of Extension:MobileFrontend. It can be configured locally to render articles from other MediaWiki instances. See this YouTube demo video

This can help you debug problems locally instead of importing articles which may have dependencies on various templates and Wikibase identifiers from production to your local instance.

This extension is a developer tool and is not recommended for production usage.

View another project

edit

The code below will turn your local MediaWiki site into a Wikivoyage viewer:

$wgMFContentProviderClass = 'MobileFrontendContentProviders\MwApiContentProvider';
$wgMFMwApiContentProviderBaseUri = 'https://en.m.wikivoyage.org/w/api.php';

This is particularly useful for testing different mobile skins in Extension:MobileFrontend using the wgMFDefaultSkinClass config option.

Testing Parsoid content

edit

The extension can be used to test content from the Parsoid parser.

$wgMFContentProviderClass = 'MobileFrontendContentProviders\ParsoidContentProvider';

Local content

edit

In some cases you may want to be able to test both local and foreign content. When enabled local content will be used if it exists. When disabled it will always be ignored.

$wgMFContentProviderTryLocalContentFirst = true;

Popups configuration

edit

To add support for Extension:Popups the following configuration is needed.

wfLoadExtension('MobileFrontendContentProvider');
wfLoadExtension('Popups');
$wgPopupsGateway = 'restbaseHTML';
$wgPopupsRestGatewayEndpoint = 'https://en.wikipedia.org/api/rest_v1/page/summary/';
$wgArticlePath = "/wiki/$1";
  1. :Fatal error: Uncaught ExtensionDependencyError: MobileFrontend is not compatible with the current MediaWiki core (version 1.32.2), it requires: >= 1.33.0.