ckeditor4 icon indicating copy to clipboard operation
ckeditor4 copied to clipboard

Support custom type attribute in scriptLoader method with new parameter

Open matthandus opened this issue 2 years ago • 0 comments

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.

matthandus avatar Feb 23 '23 14:02 matthandus