Background
Hooks::onArticleViewHeader() uses $out->addJsConfigVars() to send three config vars to the client. For config vars that don't change from request to request, the best practice is to use a virtual config.json file instead. See https://www.mediawiki.org/wiki/ResourceLoader/Package_files#Generated_content (and also https://www.mediawiki.org/wiki/ResourceLoader/Package_files#Config_files , but you probably can't use that because of the thumblimits thing).
Using the best practice will make the code more readable; will make features easier to revert without caching issues (JS has a much shorter cache life); and is more performant since it doesn't modify HTML.
Requirements
- Remove the calls to addJsConfigVars from hooks
- Add the following to packageFile and access config.json from the ifles.
{
"name": "config.json",
"config": [
"ReaderExperimentsApiBaseUri",
"ReaderExperimentsImageBrowsingExternalWikis"
]
},
{