Content-UI
Addfox provides built-in Content-UI helpers in @addfox/utils. Use these APIs in content scripts instead of hand-writing DOM mount logic.
Injection location
Content-UI should be injected in the content entry file (for example app/content/index.ts or app/content/index.tsx), not in popup/options/background entries.
Built-in methods
defineContentUI(options)
Native container mode. Returns a mount function.
defineShadowContentUI(options)
Shadow DOM mode for style isolation.
defineIframeContentUI(options)
iframe mode with the strongest isolation.
Common options
target: mount target (CSS selector or Element)attr: injected node attributes (id,class,style,data-*, etc.)injectMode: insertion mode,append | prependtag: required bydefineContentUIname: required bydefineShadowContentUI(custom element name)
Examples
- addfox-with-content-ui
UsesdefineShadowContentUIto inject a panel - addfox-with-content-ui-react
UsesdefineContentUI+ React + Tailwind

