Skip to main content
Adds a <script> tag into the page with the desired content or URL. Can be used to inject custom JavaScript into the current document. Example: addScriptTag(options: { content: "console.log('Injected');" }) or addScriptTag(options: { url: "https://example.com/script.js" }) Returns true if the script tag was successfully added.

Definition

Arguments

options

AddScriptTagOptions! Options for the script tag, such as content, URL, or ID.

Returns

Boolean! The Boolean scalar type represents true or false.