feat: Remove script element immediately in injectScript (#1761)
Co-authored-by: Aaron <aaronklinker1@gmail.com>
This commit is contained in:
@@ -32,11 +32,11 @@ export async function injectScript(
|
||||
script.src = url;
|
||||
}
|
||||
|
||||
if (!options?.keepInDom) {
|
||||
script.onload = () => script.remove();
|
||||
}
|
||||
|
||||
(document.head ?? document.documentElement).append(script);
|
||||
|
||||
if (!options?.keepInDom) {
|
||||
script.remove();
|
||||
}
|
||||
}
|
||||
|
||||
export interface InjectScriptOptions {
|
||||
|
||||
Reference in New Issue
Block a user