🧩 Plasmo Developers

PD

🧩 Plasmo Developers

Join the community to ask questions about 🧩 Plasmo Developers and get answers from other members.

Join

👾extension

👟framework

🔰newbie

🦉pallas

.html relative imports

Hey I'm trying to move my project into a monorepo. I used to have:...

How to make tab pages with vue?

I want to imgrate my code from electron to chrome extension.I can use vue at root,but tabs/ did not seem to work.

How to use shadcn-ui stylings in content script?

Hi, just starting out with a new extension and Plasmo seems too good to not give it a try! Since our brands UI is heavily relying on shadcn's styling, we're looking to also utilize it in our planned chrome extension. Sat down and managed to set it up for the popup, however no matter what I'm trying, shadcn components don't render properly using the content script....

MUI select components don't inherit styling

I'm struggling to get MUI <select> components to render correctly. I have a basic component which renders a few <MenuItems> and for some reason the <MenuItems> render at the bottom of the page completely outside of my extension. I have the styleCache and everything setup correctly and literally all of the styling is working except for the select/menuitems. Is there something in particular I need to do for this?

Extension fails to run due to Parcel - The Expression evaluated to a falsy value

About four days ago, I ran into an issue where the extension would fail to run with the following error: ``` 🟡 3 | @plasmohq/parcel-runtime Injecting << background-service-runtime >> for static/background/index.js c338908e704c91f1 /home/user/project/browser-extension/.plasmo/static/background/index.ts 🔴 ERROR | The expression evaluated to a falsy value:...

CSUI main world on Firefox MV2 (Unexpected property "world" for scripting.registerContentScripts)

i'm trying to inject my content script UI to the main world - it's working as intended with plasmo dev --target=chrome-mv3, but it's not working for plasmo dev --target=firefox-mv2 (no CSUI shows up on the page). is injecting to the main world supported for mv2? if not, are there any alternative ways to execute a pre-existing function from the main world and return the data to the CSUI? thanks! the error in devtools is: Uncaught Error: Type error for parameter scripts (Error processing 0: Unexpected property "world") for scripting.registerContentScripts. (screenshot attached) possibly relevant project information:...

Render content UI on specific URL in SPA

I am using overlay in content ui. I want to show it on a specific url. That's why i use the config below: ``` export const config: PlasmoCSConfig = { matches: ["https://*.zillow.com/*_zpid/"] }...

Injecting both Emotion cache AND local css

Howdy, I am missing a piece in my understanding. I have added the MUI css using the following script: import createCache from "@emotion/cache"...

Typescript unions not working

Hi, I'm facing a weird issue with Typescript, I have created a state like this: ```jsx const [processing, setProcessing] = useState<boolean | null>(false)...
No description

Why do I keep getting the errors of `Uncaught Error: Extension context invalidated.` and `React.jsx`

Hi there. I noticed that whenever I refresh the extension or do anything to it, the following errors just keep popping up. Please help! For context, I have checked all the imports and exports in my React code and don't see the "mixed up default and named imports" error suggested. After getting stuck for days, I don't know what else I can do to get them resolved. ...
Solution:
Hi, if you are referring to the “Extension context invalidated”, this appears when you have a content script in the page and the background script was unloaded, this most often happens when you are using the ‘dev’ command which try to refresh the content scripts automatically. If you wish to not get those error anymore, there is a flag —no-cs-reload
No description

Messaging between two content scripts

Hi! How would I go on to send a message from one content script to another using Plasmo? The basic chrome.runtime doesn't work and the Plasmo messaging functionality seems to be working backend <-> CS but not between CS. E.g if I use sendToContentScript, I get a 'Error: Extension tabs API is not available' during runtime....
Solution:
If they're in the same world wouldn't they have access to each other? Could you use window.postMessage? https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage

Losing styles when injecting popup component in CSUI

No matter if the CSUI is ```html <script context="moudule" lang="ts"> import Dashboard from "~popup.svelte"; </script>...
No description

Import a custom package styling (React-hot-toast)

Hi. I am trying to utilize the react-hot-toast package in my Plasmo content script. When importing into my React component, the basic functionality of the package works fine but all the design is gone. Is there a similar cache option for this (like MUI components have) or is there a way around it to get the package styling into CSUI? Thanks in advance!...

Anyone got devtools working with a React front end?

Struggling to get this working and would like some help.

Multiple Content Scripts on One Page Not Working As Expected

I have a project where I need to add two elements to a webpage. A button absolutely positioned / fixed on the right side of the screen. And then a button relatively positioned to another button already on the webpage. I approach it like this ```tsx...
No description

Fails to load source maps

Plasmo version: 0.83.0 I also tried removing .plasmo/, didn't help I'm on Edge on Windows 10...
No description

Plasmo adds <all_urls> content script automatically, triggering host permissions

Title. I have a contents directory with some content scripts, however the generated manifest.json also adds an additional content script:
{ "matches": ["<all_urls>"], "js": ["configs.9ddedc67.js"], "css": [] },
{ "matches": ["<all_urls>"], "js": ["configs.9ddedc67.js"], "css": [] },
...

Using NextJS API routes works in dev but not in prod

Hi folks, Thank you for building this awesome framework. I followed the next js example to get started. I was able to build a great extension (I think). I need to make outside API calls, so I created some API routes under /src/pages/api And I can call them by making an "internal API call" from the client GET $PLASMO_PUBLIC_NEXT_URL/api/something...

Plasmo's dev server doesn't always properly watch for file changes

Suppose I run plasmo dev --target=firefox-mv2 I tried to modify https://github.com/avi12/youtube-auto-hd/blob/main/src/popup/components/PromotionLinks.svelte but did not see any change in the dev server Plasmo version: 0.83.0...

Plasmo crashes when debugging on Firefox for Android

I'm trying to simultaneously run a Firefox debug session via web-ext run --target=firefox-android and run plasmo dev --target=firefox-mv2 When I modify a script, often I get: ``` Error: ENOENT: no such file or directory, unlink 'C:\repositories\extensions\youtube-auto-hd\build\firefox-mv2-de v\popup.2727c4f1.js.1756.2e'...