Skip to content

API / wxt/utils/content-script-ui/types / ContentScriptAnchoredOptions

Interface: ContentScriptAnchoredOptions ​

Source: packages/wxt/src/utils/content-script-ui/types.ts:99

Contents ​

Properties ​

anchor? ​

optional anchor?: string | Element | (() => string | Element | null | undefined) | null

Source: packages/wxt/src/utils/content-script-ui/types.ts:105

A CSS selector, XPath expression, element, or function that returns one of the three. Along with append, the anchor dictates where in the page the UI will be added.


append? ​

optional append?: ContentScriptAppendMode | ((anchor, ui) => void)

Source: packages/wxt/src/utils/content-script-ui/types.ts:122

In combination with anchor, decide how to add the UI to the DOM.

  • "last" (default) - Add the UI as the last child of the anchor element
  • "first" - Add the UI as the first child of the anchor element
  • "replace" - Replace the anchor element with the UI.
  • "before" - Add the UI as the sibling before the anchor element
  • "after" - Add the UI as the sibling after the anchor element
  • (anchor, ui) => void - Customizable function that let's you add the UI to the DOM

Generated using typedoc-plugin-markdown and TypeDoc