getTitle(); $actionName = Action::getActionName( $output->getContext() ); if ( // Don't show on edit pages $actionName !== 'edit' && $actionName !== 'submit' && // Only wikitext pages (e.g. not Flow boards) $title->getContentModel() === CONTENT_MODEL_WIKITEXT && $title->isTalkPage() // TODO: Allow non talk pages to be treated as talk pages // using a magic word. ) { $output->addModules( [ 'ext.discussionTools.init' ] ); } } }