Skip to content

API > wxt/client > ContentScriptAnchoredOptions

Interface: ContentScriptAnchoredOptions

Contents

Properties

anchor

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

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

Source

packages/wxt/src/client/content-scripts/ui/types.ts:200


append

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

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

Source

packages/wxt/src/client/content-scripts/ui/types.ts:216


Generated using typedoc-plugin-markdown and TypeDoc