🧩 Plasmo Developers

PD

🧩 Plasmo Developers

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

Join
Sir. Braden1996
Sir. Braden19963/7/2024

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?...
avi12
avi123/6/2024

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......
noxzym
noxzym3/6/2024

How to sendToBackground from main world

i've try all of messaging method but background still not receive anything
nithur
nithur3/2/2024

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?...
nithur
nithur2/29/2024

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?...
Asif
Asif2/26/2024

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"...
poyraz
poyraz2/21/2024

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...
pg2
pg22/16/2024

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: ...
MagneticSpark
MagneticSpark2/12/2024

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?
Paddy
Paddy2/12/2024

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....
frostman
frostman2/9/2024

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
Paddy
Paddy2/8/2024

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
Edmund
Edmund2/6/2024

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?
Curetix
Curetix2/2/2024

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
Miśit
Miśit2/2/2024

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://*/*"],...
Yanzhihou
Yanzhihou1/31/2024

Extension Network Question

Can a fetch in extension ( CSUI React) handled by website's service worker ?
edmund
edmund1/30/2024

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
batman12340
batman123401/29/2024

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?
DunkinDeez
DunkinDeez1/26/2024

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
seaders
seaders1/22/2024

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