Could this be resolved in ChatController::executeIndex(), with $wgOut->getResourceLoader()->addSource( )?