API > wxt/utils/inject-script > InjectScriptOptions
Interface: InjectScriptOptions
Contents
Properties
keepInDom
keepInDom?:
boolean
By default, the injected script is removed from the DOM after being injected. To disable this behavior, set this flag to true.
Source
packages/wxt/src/utils/inject-script.ts:82
manipulateScript
manipulateScript?: (
script
) =>void
|Promise
<void
>
Manipulate the script element just before it is added to the DOM.
It can be useful for e.g. passing data to the script via the dataset
property (which can be accessed by the script via document.currentScript
).
Parameters
▪ script: HTMLScriptElement
Source
packages/wxt/src/utils/inject-script.ts:90
Generated using typedoc-plugin-markdown and TypeDoc