Skip to content

API > wxt > ContentScriptIsolatedWorldDefinition

Interface: ContentScriptIsolatedWorldDefinition

Contents

Extends

Properties

allFrames

allFrames?: PerBrowserOption<undefined | boolean>

See https://developer.chrome.com/docs/extensions/mv3/content_scripts/

Default

ts
false

Inherited from

ContentScriptBaseDefinition.allFrames

Source

src/types/external.ts:510


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's css array.
  • "manual" - Exclude the CSS from the manifest. You are responsible for manually loading it onto the page. Use browser.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 calling createContentScriptUi

Default

ts
"manifest"

Inherited from

ContentScriptBaseDefinition.cssInjectionMode

Source

src/types/external.ts:529


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

ts
undefined

Inherited from

ContentScriptBaseDefinition.exclude

Source

src/types/external.ts:561


excludeGlobs

excludeGlobs?: PerBrowserOption<undefined | string[]>

See https://developer.chrome.com/docs/extensions/mv3/content_scripts/

Default

ts
[]

Inherited from

ContentScriptBaseDefinition.excludeGlobs

Source

src/types/external.ts:505


excludeMatches

excludeMatches?: PerBrowserOption<undefined | string[]>

See https://developer.chrome.com/docs/extensions/mv3/content_scripts/

Default

ts
[]

Inherited from

ContentScriptBaseDefinition.excludeMatches

Source

src/types/external.ts:495


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

ts
undefined

Inherited from

ContentScriptBaseDefinition.include

Source

src/types/external.ts:554


includeGlobs

includeGlobs?: PerBrowserOption<undefined | string[]>

See https://developer.chrome.com/docs/extensions/mv3/content_scripts/

Default

ts
[]

Inherited from

ContentScriptBaseDefinition.includeGlobs

Source

src/types/external.ts:500


matchAboutBlank

matchAboutBlank?: PerBrowserOption<undefined | boolean>

See https://developer.chrome.com/docs/extensions/mv3/content_scripts/

Default

ts
false

Inherited from

ContentScriptBaseDefinition.matchAboutBlank

Source

src/types/external.ts:488


matchOriginAsFallback

matchOriginAsFallback?: PerBrowserOption<boolean>

See https://developer.chrome.com/docs/extensions/mv3/content_scripts/

Default

ts
false

Inherited from

ContentScriptBaseDefinition.matchOriginAsFallback

Source

src/types/external.ts:515


matches

matches: PerBrowserOption<string[]>

Inherited from

ContentScriptBaseDefinition.matches

Source

src/types/external.ts:478


runAt

runAt?: PerBrowserOption<undefined | RunAt>

See https://developer.chrome.com/docs/extensions/mv3/content_scripts/

Default

ts
"documentIdle"

Inherited from

ContentScriptBaseDefinition.runAt

Source

src/types/external.ts:483


world

world?: "ISOLATED"

See https://developer.chrome.com/docs/extensions/develop/concepts/content-scripts#isolated_world

Default

ts
"ISOLATED"

Source

src/types/external.ts:458

Methods

main()

main(ctx): void | Promise<void>

Main function executed when the content script is loaded.

Parameters

ctx: ContentScriptContext

Source

src/types/external.ts:462


Generated using typedoc-plugin-markdown and TypeDoc