0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Added async attribute to signup form script tag

This commit is contained in:
Simon Backx 2023-06-02 13:59:41 +02:00
parent ba6ae472c3
commit c27b488f3d
3 changed files with 9 additions and 1 deletions

View file

@ -112,7 +112,7 @@ export default class SignupFormEmbedModal extends Component {
dataOptionsString += ` data-${key}="${escapeHtml(value)}"`;
}
const code = `<div style="${escapeHtml(style)}"><script src="${encodeURI(scriptUrl)}"${dataOptionsString}></script></div>`;
const code = `<div style="${escapeHtml(style)}"><script src="${encodeURI(scriptUrl)}"${dataOptionsString} async></script></div>`;
if (preview && this.style === 'minimal') {
// Add background

View file

@ -30,6 +30,7 @@
data-site="%VITE_SITE_URL%"
data-label-1="Signup form"
data-label-2="With logo"
async
></script>
</div>
@ -47,6 +48,7 @@
data-site="%VITE_SITE_URL%"
data-label-1="Signup form"
data-label-2="Without logo"
async
></script>
</div>
@ -61,6 +63,7 @@
data-site="%VITE_SITE_URL%"
data-label-1="Signup form"
data-label-2="Minimal"
async
></script>
</div>
@ -74,6 +77,7 @@
src="/src/index.tsx?other2"
data-button-color="#ff0095"
data-site="https://invalid/"
async
></script>
</div>
</div>

View file

@ -29,6 +29,7 @@
data-site="%VITE_SITE_URL%"
data-label-1="Signup form"
data-label-2="With logo"
async
></script>
</div>
@ -44,6 +45,7 @@
data-site="%VITE_SITE_URL%"
data-label-1="Signup form"
data-label-2="Without logo"
async
></script>
</div>
@ -57,6 +59,7 @@
data-site="%VITE_SITE_URL%"
data-label-1="Signup form"
data-label-2="Minimal"
async
></script>
</div>
@ -69,6 +72,7 @@
src="http://localhost:6174/signup-form.min.js"
data-button-color="#ff0095"
data-site="https://invalid/"
async
></script>
</div>
</div>