ckeditor / ckeditor4

The best enterprise-grade WYSIWYG editor. Fully customizable with countless features and plugins.
https://ckeditor.com/ckeditor-4
Other
5.78k stars 2.46k forks source link

Support custom type attribute in scriptLoader method with new parameter #5434

Open matthandus opened 1 year ago

matthandus commented 1 year ago

Type of report

Feature request

Provide description of the new feature

In the Drupal application, the type attribute is sometimes used to specify the module scope. The script tag that is desired looks like <script src="/path/to/file" type="module"></script>. Currently the CKEDITOR.scriptLoader method adds the default type of 'text/javascript'.

I propose we add another parameter to the scriptLoader method of type string that will render as the value of the type attribute in the script tag that is generated. We can set the type attribute parameter to be a default of 'text/javascript' so backwards compatibility is maintained. With this new feature, we will be able to set the parameter as 'module' when using scriptLoader to set the type attribute in the script tag.