aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2025-03-17 23:21:04 +0800
committerGitHub <noreply@github.com>2025-03-17 15:21:04 +0000
commitfdaf1cca65e118562b3cc2eb9e7c077b28f77213 (patch)
tree042cd7131f495993e17d48ad2d7e15ea7606b7f4 /templates
parente1feb438a49b194e73e504eb7018e4d50f3978cd (diff)
downloadgitea-fdaf1cca65e118562b3cc2eb9e7c077b28f77213.tar.gz
gitea-fdaf1cca65e118562b3cc2eb9e7c077b28f77213.zip
Defer captcha script loading (#33919)
Fix #33899
Diffstat (limited to 'templates')
-rw-r--r--templates/user/auth/captcha.tmpl6
1 files changed, 3 insertions, 3 deletions
diff --git a/templates/user/auth/captcha.tmpl b/templates/user/auth/captcha.tmpl
index 8dd4d1cc51..6779948da5 100644
--- a/templates/user/auth/captcha.tmpl
+++ b/templates/user/auth/captcha.tmpl
@@ -10,12 +10,12 @@
<div class="inline field tw-text-center required">
<div id="captcha" data-captcha-type="g-recaptcha" class="g-recaptcha-style" data-sitekey="{{.RecaptchaSitekey}}"></div>
</div>
- <script src='{{URLJoin .RecaptchaURL "api.js"}}'></script>
+ <script defer src='{{URLJoin .RecaptchaURL "api.js"}}'></script>
{{else if eq .CaptchaType "hcaptcha"}}
<div class="inline field tw-text-center required">
<div id="captcha" data-captcha-type="h-captcha" class="h-captcha-style" data-sitekey="{{.HcaptchaSitekey}}"></div>
</div>
- <script src='https://hcaptcha.com/1/api.js'></script>
+ <script defer src='https://hcaptcha.com/1/api.js'></script>
{{else if eq .CaptchaType "mcaptcha"}}
<div class="inline field tw-text-center">
<div class="m-captcha-style" id="mcaptcha__widget-container"></div>
@@ -25,5 +25,5 @@
<div class="inline field tw-text-center">
<div id="captcha" data-captcha-type="cf-turnstile" data-sitekey="{{.CfTurnstileSitekey}}"></div>
</div>
- <script src='https://challenges.cloudflare.com/turnstile/v0/api.js'></script>
+ <script defer src='https://challenges.cloudflare.com/turnstile/v0/api.js'></script>
{{end}}{{end}}