Same name in other branches
- 5.0.x advagg_mod/src/EventSubscriber/InitSubscriber.php \Drupal\advagg_mod\EventSubscriber\InitSubscriber::removeConsoleLog()
- 6.0.x advagg_mod/src/EventSubscriber/InitSubscriber.php \Drupal\advagg_mod\EventSubscriber\InitSubscriber::removeConsoleLog()
- 8.x-3.x advagg_mod/src/EventSubscriber/InitSubscriber.php \Drupal\advagg_mod\EventSubscriber\InitSubscriber::removeConsoleLog()
Pass the JS to the modifier if enabled to remove console logging.
Paramètres
\Drupal\advagg\Asset\AssetOptimizationEvent $assetOptimizationEvent: The JS optimization event.
Fichier
-
advagg_mod/
src/ EventSubscriber/ InitSubscriber.php, line 182
Classe
- InitSubscriber
- Perform initialization tasks for advagg_mod.
Namespace
Drupal\advagg_mod\EventSubscriberCode
public function removeConsoleLog(AssetOptimizationEvent $assetOptimizationEvent) {
// Skip if not enabled.
if (!$this->config
->get('js_remove_console_log')) {
return;
}
$content = $assetOptimizationEvent->getContent();
$content = $this->consoleLogRemover
->optimize($content);
$assetOptimizationEvent->setContent($content);
}