content-ui-inject

Boost content-ui injection for better extension developer experience.

content-ui-inject

npm version npm downloads bundle JSDocs License

Boost content-ui injection for better extension developer experience.

Quick start

  1. Inject shadowRoot to content-ui
import { createShadowRootUI } from 'content-ui-injector'
const app = await createShadowRootUI({
  name: 'react-boilerplate',

  position: 'inline',
  injectAnchor: 'body',
  injectMode: 'before',
  styleOptions: {
    textContent: tailwindcssOutput,
  },
  onCustomize: (uiContainer, shadowHost) => {
    shadowHost.style.zIndex = '9999'
    shadowHost.id = 'xxx'
  },
  onMount: (uiContainer) => {
    createRoot(uiContainer).render(<App />)
  },
})

app.mount()

License

MIT License © 2023-PRESENT leizhenpeng