🧩 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

Supabase url and anon key exposed

I am a newbie exploring Plasmo for supabase authentication. The public url and anon keys are added in the .env file. On building the file, I find the supabase url and anon keys are exposed in popup.js, which can be traced in Devtool sources. The bad actors may use the url and anonkey to exploit the auth.
What are the best ways to deal with supabase auth without exposing the url and key? Am I missing something?...

Firefox dev server manifest warnings

The ```json { "content_security_policy": { "extension_pages": "script-src 'self' http://localhost;object-src 'self';"...
No description

import url no longer working

Hey folks 👋🏻 just upgraded our extension at Attio to the latest version of Plasmo (0.85). It seems we can no longer include HTML into the bundle by doing: import doc from “url:test.html”. I’ve instead included the file as a web_accessible_resource, but the TS it imports can of course not be found as it’s no longer bundled. Is there an easy way to include this in the output?...

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?