Drupal.behaviors.customCKEditorConfig
This is working.

use Drupal\editor\Entity\Editor;

function MYMODULE_editor_js_settings_alter(array &amp;$settings) {
  foreach ($settings['editor']['formats'] as $name =&gt; $value) {
    $settings['editor']['formats'][$name]['editorSettings']['disallowedContent'] =   
'h1 h2 h3';
  }
}


This supersedes any allowed tags in the drupal GUI. But you must enable Allowed HTML tags enabled for this to work. I took the idea from this.drupal-8-ckeditor-behaves-ltr