The reCaptcha module adds a Javascript with hook_captcha(). I want to add another attribute "type" to this script tag. I can't find a hook to achieve this.
Here is the code from the recaptcha.module (line 118):
$captcha['form']['recaptcha_widget'] = [
'#markup' => '<div' . new Attribute($attributes) . '></div>',
'#suffix' => $noscript,
'#attached' => [
'html_head' => [
[
[
'#tag' => 'script',
'#attributes' => [
'src' => Url::fromUri($recaptcha_src, ['query' => ['hl' => \Drupal::service('language_manager')->getCurrentLanguage()->getId()], 'absolute' => TRUE])->toString(),
'async' => TRUE,
'defer' => TRUE,
],
],
'recaptcha_api',
],
],
],
];
When I try to access the script tag with e.g. hook_page_attachments_alter() or any other hook_preprocess_xxxx() it is missing. I also tried to increase my module weight.