(script: HTMLScriptElement)
| 119 | const scriptId = jsId || `script-${btoa(url).slice(0, 12)}`; |
| 120 | |
| 121 | const cleanupScript = (script: HTMLScriptElement) => { |
| 122 | if (script && script.parentElement) { |
| 123 | script.parentElement.removeChild(script); |
| 124 | } |
| 125 | }; |
| 126 | |
| 127 | return new Promise((resolve, reject) => { |
| 128 | if (typeof document === 'undefined') { |