-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chrome extension: Using @mui v5 in content-script with "run_at": "document_start"
gives error in @emotion library
#42249
Comments
Since the issue is missing key information and has been inactive for 7 days, it has been automatically closed. If you wish to see the issue reopened, please provide the missing information. |
@brijeshb42 Do you have the |
I checked again with what you said ^. It worked with this as well. I just had to wrap the main code in a import { createRoot } from 'react-dom/client'
import Typography from '@mui/material/Typography'
console.log('Hello extensions')
document.addEventListener('DOMContentLoaded', () => {
const appRoot = document.createElement('div')
appRoot.id = 'ext-root'
document.getElementById('zoom-ui-frame')?.prepend(appRoot)
createRoot(appRoot).render(<Typography variant="h2">Hello From extension</Typography>)
}) |
In my case, I am running a content script on a Zoom invitation page. This page, weirdly, doesn't trigger the event What I did to load react was to wait, specifically, for a div (that I know will exist), by using a mutation observer, and then load the react. |
But I still get the error in @mui / emotion, this was my original logic. |
Steps to reproduce
Link to live example: (requires to build a chrome extension)
It's difficult to create a reproducible example for a chrome-extension, so I'll try to simplify the steps after that.
a. Add the following to the manifest. I'm running my content-script on zoom
Current behavior
Uncaught TypeError: Cannot read properties of null (reading 'insertBefore')
Expected behavior
To load the mui components
Context
I am creating an extension for when a user opens a zoom link it adds a button bellow the 'Launch Meeting' zoom button. I was trying to using @mui to create that button and everything else, but no success.
Your environment
npx @mui/envinfo
tsconfig.json
Search keywords: emotion; mui-v5; content-script.
The text was updated successfully, but these errors were encountered: