API > wxt > BaseContentScriptEntrypointOptions
Interface: BaseContentScriptEntrypointOptions
Contents
Extends
Properties
allFrames
allFrames?:
PerBrowserOption<undefined|boolean>
See https://developer.chrome.com/docs/extensions/mv3/content_scripts/
Default
falseSource
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'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 callingcreateShadowRootUi
Default
"manifest"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
Source
excludeGlobs
excludeGlobs?:
PerBrowserOption<undefined|string[]>
See https://developer.chrome.com/docs/extensions/mv3/content_scripts/
Default
[]Source
excludeMatches
excludeMatches?:
PerBrowserOption<undefined|string[]>
See https://developer.chrome.com/docs/extensions/mv3/content_scripts/
Default
[]Source
globalName
globalName?:
string|boolean| (entrypoint) =>string
The variable name for the IIFE in the JS output bundle.
This option is for content scripts with world=MAIN, and unlisted scripts. It's relevant for scripts that are inserted into the page context where the default IIFE variable name may conflict with an existing variable on the target page. This applies to content scripts with world=MAIN, and others, such as unlisted scripts, that could be dynamically injected into the page with a <script> tag.
Available options:
true: automatically generate a name for the IIFE based on the entrypoint namefalse: Output the IIFE without a variable name, making it anonymous. This is the safest option to avoid conflicts with existing variables on the page. This will become the default in a future version of WXT.string: Use the provided string as the global variable name.function: A function that receives the entrypoint and returns a string to use as the variable name.
Default
trueInherited from
BaseEntrypointOptions.globalName
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
Source
includeGlobs
includeGlobs?:
PerBrowserOption<undefined|string[]>
See https://developer.chrome.com/docs/extensions/mv3/content_scripts/
Default
[]Source
matchAboutBlank
matchAboutBlank?:
PerBrowserOption<undefined|boolean>
See https://developer.chrome.com/docs/extensions/mv3/content_scripts/
Default
falseSource
matchOriginAsFallback
matchOriginAsFallback?:
PerBrowserOption<boolean>
See https://developer.chrome.com/docs/extensions/mv3/content_scripts/
Default
falseSource
matches
matches?:
PerBrowserOption<string[]>
Source
registration
registration?:
PerBrowserOption<"runtime"|"manifest">
Specify how the content script is registered.
"manifest": The content script will be added to thecontent_scriptsentry in the manifest. This is the normal and most well known way of registering a content script."runtime": The content script'smatchesis added tohost_permissionsand you are responsible for using the scripting API to register/execute the content script dynamically at runtime.
Default
"manifest"Source
runAt
runAt?:
PerBrowserOption<undefined|RunAt>
See https://developer.chrome.com/docs/extensions/mv3/content_scripts/
Default
"documentIdle"Source
Generated using typedoc-plugin-markdown and TypeDoc