Skip to content

content script shadowui not work, but integrateui work #2041

@zshnb

Description

@zshnb

Describe the bug

I'm using React to build a content script, first I try use createShadowRootUi to mount onto page, but is doens't work, then I change to createIntegratedRootUi it works. I use tailwindcss + React.

Reproduction

contentui-issue.zip

Steps to reproduce

  1. download zip file, delete node_modules dir, then run pnpm i
  2. run npm run dev, then open youtube, nothing shows on page
  3. modify content.tsx, code is below
const floatUi = createIntegratedUi(ctx, {
      position: 'inline',
      anchor: 'body',
      onMount: (container) => {
        const root = ReactDOM.createRoot(container);
        root.render(<FloatToolbar />);
        return root;
      },
      onRemove: (root) => {
        root?.unmount();
      },
    });

after refresh you can see a float box on page

Image

System Info

System:
    OS: macOS 15.6.1
    CPU: (14) arm64 Apple M4 Pro
    Memory: 2.78 GB / 48.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 24.12.0 - /Users/zsh/.nvm/versions/node/v24.12.0/bin/node
    npm: 11.6.2 - /Users/zsh/.nvm/versions/node/v24.12.0/bin/npm
    pnpm: 10.26.2 - /Users/zsh/Library/pnpm/pnpm
  npmPackages:
    wxt: ^0.20.6 => 0.20.13

Used Package Manager

pnpm

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    pending-triageSomeone (usually a maintainer) needs to look into this to see if it's a bug

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions