Skip to content

Commit

Permalink
Remove "defer" and "async" on inline scripts (fixes DieSchittigs#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
bennyborn committed Feb 24, 2020
1 parent 1e633ea commit 6253da5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php if ($this->recaptchaType != 'recaptcha3') return; ?>

<script src="https://www.google.com/recaptcha/api.js?onload=onRecaptchaLoadCallbackModule<?= $this->id ?>&render=<?= $this->publicKey ?>" defer async></script>
<script type="text/javascript" defer async>
<script>
function onRecaptchaLoadCallbackModule<?= $this->id ?> () {
grecaptcha.execute('<?= $this->publicKey ?>', {action: '<?= $this->action ?>'})
}
Expand Down
4 changes: 2 additions & 2 deletions src/Resources/contao/templates/form_recaptcha.html5
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
<p class="error"><?= $this->getErrorAsString() ?></p>
<?php endif; ?>

<div class="g-recaptcha"
<div class="g-recaptcha"
id="recaptcha-<?= $this->strCaptchaKey ?>"
data-sitekey="<?= $this->publicKey ?>"
data-callback="onSubmit_<?= $this->strCaptchaKey ?>"
<?php if ($this->recaptchaType == 'invisible'): ?> data-size="invisible" <?php endif; ?>
></div>

<script src="https://www.google.com/recaptcha/api.js?onload=onRecaptchaLoadCallbackField<?= $this->strCaptchaKey ?><?php if ($this->recaptchaType == 'recaptcha3'): ?>&render=<?= $this->publicKey ?><?php endif; ?>" defer async></script>
<script type="text/javascript" defer async>
<script>
function onRecaptchaLoadCallbackField<?= $this->strCaptchaKey ?> () {
window.onSubmit_<?= $this->strCaptchaKey ?> = function () { };

Expand Down

0 comments on commit 6253da5

Please sign in to comment.