It's not really clear how to add custom attributes when adding an external JS script to the page.
Currently I have this code:
drupal_add_js('https://code.jquery.com/jquery-3.4.1.js', array('type' => 'external'));
How can I add an
integrity attribute to the rendered script tag?
The rendered script should look like this:
<script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU="></script>
I know this post exists, but I'm not able to use that solution since the source is loaded externally and I will not be able to check on the source.