bwbama85
bwbama85
PD🧩 Plasmo Developers
Created by bwbama85 on 6/14/2023 in #🔰newbie
Multiple root containers question
I'll eventually combine them into one but was separating them to ease debugging at first only to find the mobile one did not work at all. Thanks for the guidance so far. Will keep chipping away and see what I can come up with
11 replies
PD🧩 Plasmo Developers
Created by bwbama85 on 6/14/2023 in #🔰newbie
Multiple root containers question
oilPriceDesktop.tsx and oilPriceMobile.tsx inside contents folder
11 replies
PD🧩 Plasmo Developers
Created by bwbama85 on 6/14/2023 in #🔰newbie
Multiple root containers question
This is the second content script:
export const getRootContainer = () =>
new Promise((resolve) => {
const checkInterval = setInterval(() => {
const mobileContainerParent = document.querySelector(
"div.mobileOnly span.topBarDetails span.delegatesShortcut.clickable"
)
if (mobileContainerParent) {
clearInterval(checkInterval)
const mobileContainerParent = document.createElement("span")
mobileContainerParent.after(mobileContainerParent)
resolve(mobileContainerParent)
}
}, 137)
})

export const render: PlasmoRender<PlasmoCSUIJSXContainer> = async ({ createRootContainer }) => {
const rootContainer = await createRootContainer()
const root = createRoot(rootContainer)
root.render(<OilOverlay />)
}
export const getRootContainer = () =>
new Promise((resolve) => {
const checkInterval = setInterval(() => {
const mobileContainerParent = document.querySelector(
"div.mobileOnly span.topBarDetails span.delegatesShortcut.clickable"
)
if (mobileContainerParent) {
clearInterval(checkInterval)
const mobileContainerParent = document.createElement("span")
mobileContainerParent.after(mobileContainerParent)
resolve(mobileContainerParent)
}
}, 137)
})

export const render: PlasmoRender<PlasmoCSUIJSXContainer> = async ({ createRootContainer }) => {
const rootContainer = await createRootContainer()
const root = createRoot(rootContainer)
root.render(<OilOverlay />)
}
11 replies
PD🧩 Plasmo Developers
Created by bwbama85 on 6/14/2023 in #🔰newbie
Multiple root containers question
Hi Louis, Yes mobileOnly always exist. Its a rather old code style that has both mobile and desktop styles always on the page. I will do a bit more debugging and see if I can figure it out. Was just making sure I wasn't making an error in how I was setting two root containers or something like that.
11 replies
PD🧩 Plasmo Developers
Created by bwbama85 on 6/6/2023 in #👟framework
Importing NPM Module JavaScript into web page issue
For the time being I am just going to use the FusionCharts that is already on the page, but would be interested in why the import isn't pulling in all the files that I need or how I could also pull in the .charts file since it is just 404ing and the other error seems to be misguided, reading the 404 page.
2 replies