API > wxt > ContentScriptMainWorldDefinition
Interface: ContentScriptMainWorldDefinition
Contents
Extends
Properties
allFrames
allFrames?:
PerBrowserOption<undefined|boolean>
See https://developer.chrome.com/docs/extensions/mv3/content_scripts/
Default
falseInherited from
ContentScriptBaseDefinition.allFrames
Source
cssInjectionMode
cssInjectionMode?:
PerBrowserOption<"ui"|"manifest"|"manual">
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'scssarray."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 callingcreateContentScriptUi
Default
"manifest"Inherited from
ContentScriptBaseDefinition.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
undefinedInherited from
ContentScriptBaseDefinition.exclude
Source
excludeGlobs
excludeGlobs?:
PerBrowserOption<undefined|string[]>
See https://developer.chrome.com/docs/extensions/mv3/content_scripts/
Default
[]Inherited from
ContentScriptBaseDefinition.excludeGlobs
Source
excludeMatches
excludeMatches?:
PerBrowserOption<undefined|string[]>
See https://developer.chrome.com/docs/extensions/mv3/content_scripts/
Default
[]Inherited from
ContentScriptBaseDefinition.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
undefinedInherited from
ContentScriptBaseDefinition.include
Source
includeGlobs
includeGlobs?:
PerBrowserOption<undefined|string[]>
See https://developer.chrome.com/docs/extensions/mv3/content_scripts/
Default
[]Inherited from
ContentScriptBaseDefinition.includeGlobs
Source
matchAboutBlank
matchAboutBlank?:
PerBrowserOption<undefined|boolean>
See https://developer.chrome.com/docs/extensions/mv3/content_scripts/
Default
falseInherited from
ContentScriptBaseDefinition.matchAboutBlank
Source
matchOriginAsFallback
matchOriginAsFallback?:
PerBrowserOption<boolean>
See https://developer.chrome.com/docs/extensions/mv3/content_scripts/
Default
falseInherited from
ContentScriptBaseDefinition.matchOriginAsFallback
Source
matches
matches:
PerBrowserOption<string[]>
Inherited from
ContentScriptBaseDefinition.matches
Source
runAt
runAt?:
PerBrowserOption<undefined|RunAt>
See https://developer.chrome.com/docs/extensions/mv3/content_scripts/
Default
"documentIdle"Inherited from
ContentScriptBaseDefinition.runAt
Source
world
world:
"MAIN"
See https://developer.chrome.com/docs/extensions/develop/concepts/content-scripts#isolated_world
Source
Methods
main()
main():
void|Promise<void>
Main function executed when the content script is loaded.
Source
Generated using typedoc-plugin-markdown and TypeDoc