🧩 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

Parallel dev servers

I need to both run plasmo dev --verbose and plasmo dev --verbose --target=firefox-mv3, but when I run the latter I get ``` 🔵 INFO | Starting the extension development server... 🟡 1 | Starting dev server on localhost:52111, HMR on localhost:52112... 🟡 2 | Creating Manifest Factory......

How to sendToBackground from main world

i've try all of messaging method but background still not receive anything

button click inside CSUI closes the CSUI

When I click on a button inside the injected CSUI, the whole component is closing. I am using a useeffect with an event listener for mouseup event. However when I add the event listener to document.body instead of document, it works properly. But the problem is I can't add some event listeners to document body. Did anyone face this issue before?...

anyone got any good example of CSUI lifecycle?

I have been going through the official docs back and forth but still having tough time to fully grasp that concept. I managed to build something that adds a div to the page and then mounting the CSUI through it. But I feel like I am not using it properly. Anyone got any good examples of CSUI lifecycle?...

Rendering issue on single page application (SPA) like youtube

I am trying to make something for youtube where i am using inline anchor. I want to inject a button on every video on youtube homepage. My code is here ``` import cssText from "data-text:~contents/style.css" import type { PlasmoCSConfig, PlasmoGetInlineAnchorList } from "plasmo"...

useStorage makes extension window tiny.

every time i use the useStorage hook my windows resizes it's driving me crazy const [datas] = useStorage("auth_session") whenever i use this code my window becomes 1px by 1px...

Uncaught ReferenceError: Cannot access 'fromCurrentPageConfig' before initialization

Hi everyone! I've been building a Plasmo extension, and my dev build suddenly started breaking. The build actually finishes, but when I try to run the extension, I get: Uncaught ReferenceError: Cannot access 'fromCurrentPageConfig' before initialization fromCurrentPageConfig is an object I have in my code. Looking at the compiled popup.7d3dc21e.js file, I see this: ...

How to listen to a Port's disconnect event?

I created an entry file in background/ports/foo.ts, and I'd like to listen to onConnect/onDisconnect events (I want to know when the user has closed a certain tab). Is there a standard way to do this with plasmo?

Options and popup extension pages both working?

Hey, I got the Supabase options authentication, but I want after authentication also the popup to be working, how do I get the popup to work and the options page to work at the same time as currently its only one or the other. Thank you in advance....

Pin Side Panel like google search

I've been searching for a way to enable a direct button for my extension Side Panel. Accessing it each time through the side panel button and then selecting my extension is cumbersome. Has anyone found a solution or a way to trigger it with a keyboard shortcut?
No description

Adding Supabase later instead of starting with it?

Hey everyone, I started a Plasmo project initially --with-nextjs, now I want to use the Messaging API to communicate with my Supabase REST API, could I follow the docs of Supabase Plasmo afterwards or do I have to start with the --with-supabase to make this properly work? Best regards....
Solution:
you should be able to add it in later. The --with examples are just quickstarts to get you going

How can I listen to all requests?

I am trying to create an extension that will intercept all requests that were made on the webpage. How can I do this?

Build fails after changing TS path alias

I changed the default path alias from "~*": ["./src/*"] to "~/*": ["./src/*"] and updated all imports in the project accordingly. tsc does not report any issues, and vite build builds the web version just fine, but plasmo build fails with an error from the Parcel package (see screenshot). Any ideas? Windows 11, Plasmo 0.84.2, Node 20.11.0, TypeScript 5.3.3...
No description

Disable content-ui per site

Hi, I'm developing pretty advanced extension and got a request for option to disable/enable the extension per site By browsing the google docs i know that there's something like exclude_matches but this is static one. How can I achieve it to be dynamic? ``` export const config: PlasmoCSConfig = { matches: ["https://*/*"],...

Extension Network Question

Can a fetch in extension ( CSUI React) handled by website's service worker ?

CSUI Best practices question

Can I get some advice on what is the best way for me to append a new button shown in the screenshots? The inspected the element and it doesn't seem to have a unique id i can target in the content script. My first hunch is to use querySelector but I think this is a very brittle method....
No description

Plasmo setup with NX console

Hello everyone, I'm trying to create an extension app inside my nx monorepo and really would love to use plasmo. I've managed to figure out how to define custom src and build paths, but I still have to create the assets folder and the tsconfig in the root. Is there a way to define their paths as well?

Is it possible to wrap page elements in the document root?

Context is that i'm trying to use MUI tabs to add additional content with the page document as the first tab thats selected. I'm assuming if it's possible it would be necessary to create it using a custom root container. I'm just not sure how to go about including the initial page in the root render if thats even possible.
Solution:
Figured out a workaround to this by using a useEffect and performing document operations based on the dependency value

Excluding library from build

Hey guys, we're currently experiencing this issue with our recent build https://github.com/firebase/firebase-js-sdk/issues/7617 Basically, firebase's sdk includes a random dynamic connection to recaptcha libraries which then means the Chrome Web Store will reject it for remote code. The specific pain point for many people is only needed if you use a phone number for login reasons. We're not doing that, and we're not going to be doing that, and we'd like to remove that from our project completely, pre-build, if possible....
No description

Chakra UI toast

Has anyone been able to integrate Chakra ui with plasmo. The problem arises because the cache providet is a child of Chakra provider hence the elements like tooltips and toasts do not have any styles....