API > wxt > IsolatedWorldContentScriptDefinition
Interface: IsolatedWorldContentScriptDefinition
Contents
Extends
Properties
allFrames
allFrames?:
PerBrowserOption
<undefined
|boolean
>
See https://developer.chrome.com/docs/extensions/mv3/content_scripts/
Default
false
Inherited from
IsolatedWorldContentScriptEntrypointOptions
.allFrames
Source
cssInjectionMode
cssInjectionMode?:
PerBrowserOption
<"manifest"
|"manual"
|"ui"
>
Customize how imported/generated styles are injected with the content script. Regardless of the mode selected, CSS will always be built and included in the output directory.
"manifest"
- Include the CSS in the manifest, under the content script'scss
array."manual"
- Exclude the CSS from the manifest. You are responsible for manually loading it onto the page. Usebrowser.runtime.getURL("content-scripts/<name>.css")
to get the file's URL"ui"
- Exclude the CSS from the manifest. CSS will be automatically added to your UI when callingcreateShadowRootUi
Default
"manifest"
Inherited from
IsolatedWorldContentScriptEntrypointOptions
.cssInjectionMode
Source
exclude
exclude?:
string
[]
List of target browsers to exclude this entrypoint from. Cannot be used with include
. You must choose one of the two options.
Default
undefined
Inherited from
IsolatedWorldContentScriptEntrypointOptions
.exclude
Source
excludeGlobs
excludeGlobs?:
PerBrowserOption
<undefined
|string
[]>
See https://developer.chrome.com/docs/extensions/mv3/content_scripts/
Default
[]
Inherited from
IsolatedWorldContentScriptEntrypointOptions
.excludeGlobs
Source
excludeMatches
excludeMatches?:
PerBrowserOption
<undefined
|string
[]>
See https://developer.chrome.com/docs/extensions/mv3/content_scripts/
Default
[]
Inherited from
IsolatedWorldContentScriptEntrypointOptions
.excludeMatches
Source
include
include?:
string
[]
List of target browsers to include this entrypoint in. Defaults to being included in all builds. Cannot be used with exclude
. You must choose one of the two options.
Default
undefined
Inherited from
IsolatedWorldContentScriptEntrypointOptions
.include
Source
includeGlobs
includeGlobs?:
PerBrowserOption
<undefined
|string
[]>
See https://developer.chrome.com/docs/extensions/mv3/content_scripts/
Default
[]
Inherited from
IsolatedWorldContentScriptEntrypointOptions
.includeGlobs
Source
matchAboutBlank
matchAboutBlank?:
PerBrowserOption
<undefined
|boolean
>
See https://developer.chrome.com/docs/extensions/mv3/content_scripts/
Default
false
Inherited from
IsolatedWorldContentScriptEntrypointOptions
.matchAboutBlank
Source
matchOriginAsFallback
matchOriginAsFallback?:
PerBrowserOption
<boolean
>
See https://developer.chrome.com/docs/extensions/mv3/content_scripts/
Default
false
Inherited from
IsolatedWorldContentScriptEntrypointOptions
.matchOriginAsFallback
Source
matches
matches?:
PerBrowserOption
<string
[]>
Inherited from
IsolatedWorldContentScriptEntrypointOptions
.matches
Source
registration
registration?:
PerBrowserOption
<"runtime"
|"manifest"
>
Specify how the content script is registered.
"manifest"
: The content script will be added to thecontent_scripts
entry in the manifest. This is the normal and most well known way of registering a content script."runtime"
: The content script'smatches
is added tohost_permissions
and you are responsible for using the scripting API to register/execute the content script dynamically at runtime.
Default
"manifest"
Inherited from
IsolatedWorldContentScriptEntrypointOptions
.registration
Source
runAt
runAt?:
PerBrowserOption
<undefined
|RunAt
>
See https://developer.chrome.com/docs/extensions/mv3/content_scripts/
Default
"documentIdle"
Inherited from
IsolatedWorldContentScriptEntrypointOptions
.runAt
Source
world
world?:
"ISOLATED"
See https://developer.chrome.com/docs/extensions/develop/concepts/content-scripts#isolated_world
Default
"ISOLATED"
Inherited from
IsolatedWorldContentScriptEntrypointOptions
.world
Source
Methods
main()
main(
ctx
):any
Main function executed when the content script is loaded.
When running a content script with browser.scripting.executeScript
, values returned from this function will be returned in the executeScript
result as well. Otherwise returning a value does nothing.
Parameters
▪ ctx: ContentScriptContext
Source
Generated using typedoc-plugin-markdown and TypeDoc