How to add a custom attribute to the script tag via drupal_add_js? As part of API implementation of Queue-it framework, I need to add extra custom attribute data-queueit-c into script tag, e.g.

&lt;script 
    data-queueit-c="MyClientID" 
    type="text/javascript" 
    src="//static.queue-it.net/script/queueconfigloader.min.js"&gt;
&lt;/script&gt;


I'm aware you can add other attributes such as defer, however this one is custom.

I've tried the following code using drupal_add_js, but without luck:

drupal_add_js('//static.queue-it.net/script/queueconfigloader.min.js',
  [ 
    'type' =&gt; 'external',
    'data-queueit-c' =&gt; 'MyClientID',
  ]);


How this can be achieved?
It's old but I have the same problem (adding "crossorigin" attribute) and this is my answer :


There is an issue about it here : https://www.drupal.org/project/drupal/issues/1664602
@kenorb solution can't work because "drupal_add_js" add "script" tag automatically.
But... you can try this workaround (a little dirty) :
close the script tag and open yours without closing


.

drupal_add_js('//--&gt;&lt;!]]&gt;&lt;/script&gt;&lt;script src="//static.queue-it.net/script/queueconfigloader.min.js" data-queueit-c="MyClientID"&gt;&lt;!--//--&gt;&lt;![CDATA[//&gt;&lt;!--', 'inline');