To mount your content page CSUI inside
To mount your content page (CSUI) inside an iframe instead of a shadow DOM using
1. Export a
In this example, we create an
2. Update your Plasmo configuration to use the
Make sure to replace
3. Build and run your Plasmo extension. When your extension is loaded, the
By using the
getRootContainer, you can follow these steps:1. Export a
getRootContainer function in your Plasmo extension code. This function will be responsible for returning the root container element where your CSUI will be mounted. Here's an example:In this example, we create an
iframe element and set its src attribute to the URL of your CSUI page. You can replace "your-csui-page.html" with the actual URL of your CSUI page.2. Update your Plasmo configuration to use the
getRootContainer function. In your Plasmo configuration file, import the getRootContainer function and assign it to the getRootContainer property. Here's an example:Make sure to replace
"./your-root-container-file" with the actual path to your root container file.3. Build and run your Plasmo extension. When your extension is loaded, the
getRootContainer function will be called, and the CSUI will be mounted inside the iframe returned by the function.By using the
getRootContainer function and returning an iframe element, you can mount your CSUI inside an iframe instead of a shadow DOM. This can be useful in scenarios where you need more control over the styling or behavior of your CSUI, or if you want to isolate it from the web page's DOM.