🧩 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

Sidepanel as main

i'm trying to trigger Plasmo SidePanel when user clicks on the extension icon. but i can't get it to work. any solution on ideas? what i need is to open a side panel from right side of the screen taking the full height. how else is it possible?...

Typescript Confusion

I am working on a very simple extension that collects some data off the page and stores it locally. The data is stored as an array of object. When using the storage API to retrieve the data it seems like the LSP or linter is confused. VSCode shows the type of data as a string but logging typeof in the browser it tells me its a object but I only have this issue when using the .then syntax of the promise. If I use async/await I can cast it correctly to my custom type but I'm not sure how to do this from a .then resolution. ...
No description

await not defined

hey! just trying out the basic extension framework using create plasmo. had the basics working, but it seems like my background script shows errors with chrome as soon as i try to use async code. is that expected? seems to have failed after i added a dependency on idb...

Logging user errors

Anyone have any suggestions on any libraries or strategies that you use to log errors coming from users for troubleshooting or getting ahead of issues? I’ve seen a few out there, wondering what folks are typically doing.

with-message example

How can I get with-message example to fully work? Including communication between tabs and content with background

tab page works with pnpm run dev but is blocked when i run pnpm build and pnpm package

When I upload my zipfile to plasmo itero, none of my users can access the tab page. however It works perfectly fine on my computer when I run pnpm run dev. What should I do? Ive been stuck on this issue for over a day now 😭

How to fetch current tab localStorage?

How to use this storage Api in plasmo to to fetch the localStorage of the current open tab?. And where is the storage located. I have searched in localStorage and shared storage I don't see my key values but somehow can see logs...

background error

Im using the with background example, I don't see any console log on the service worker. How can I solve this? Ty...

Unable to install storage API in my project

started a new project recently and the API is not getting installed locally, whenever I try to "pnpm install @plasmohq/storage", I get this warning "Moving @types/react-dom that was installed by a different package manager to "node_modules/.ignored" and then an error. Also prettier is not working
No description

how to change inlineInsertPosition?

There is no example in docs, and this feature was added on Nov 9, 2023. Please help

Is there a way to build a webapp or electron app based on a Plasmo project?

Hello We're building a browser extension, but for the sake of testing we may just test the web-app part without all chrome APIs part; is there a way to do a distribution as a webapp? Another question, can we target to electron in the future?...

How to make absolute button CSUI

Hey, a newbie here trying to create a button that appears on certain pages, always on the bottom right of the screen (this location never changes.) I know plasmo has a neat CSUI system that can render react components through just exporting them through .tsx files in a contents directory. However, this code doesn't seem to work, and when I try and anchor it to any other element (h1, as shown in picture) it is no longer absolute to the bottom right of the screen, and it scrolls along with the page. Is there something I'm doing wrong? I tried just appending a vanilla button in my content.js file and it worked perfectly, as shown in the photo. But given that I'm using ant design and plasmo, I'd like to be able to render react elements in the clean plasmo CSUI way. ...
No description

How to listen to all HTTP requests?

I'm trying to build an extension that allows me to listen to HTTP requests, much like chrome.webRequest does. Is there a way to do this with Plasmo?

How do I disable the popup in dev mode?

Hi, newbie here. I'm trying to make it so that I can disable/enable the popup in the options page but I don't even know how to disable the popup in dev mode.

Is Vanilla JavaScript supported?

Hey! Does Plasmo support vanilla JavaScript only?

Struggling with Plasmo Messaging API: Sending Message from CSUI to BGSW Issue

Hey guys, I've tried so far to understand how Plasmo Messaging API works (from CSUI to BGSW) and although I read through the whole Doc again and again I still miss some key understanding. Long story short, I try to send to the background a message 'clipboards' via a
useEffect
useEffect
from
content.tsx
content.tsx
: ```useEffect(() => { //extensionId is defined as the CSUI injected in the main world...

Style / Font consistency between content scripts

Hey! I'm wondering if anyone else has ran into issues with content script's styling and fonts being applied differently accross web pages? It's kinda jarring when I'm trying to create a persistant look between pages.

Building a standalone Embed

Hey everyone! I have an extension I've been building with Plasmo for work and we were asked to also bundle it as an embeddable widget for sites to include on their page without needing the chrome extension installed. I was wondering if anyone here had any tips on how to go about doing this. Obviously there are a lot of extension-specific APIs that can't be re-used, but we'd like to re-use as much as the UI as possible and bundle it in a similar way. We've tried using the parcel bundler like parcel build ./src/widget/index.tsx --target widget with the target specified in the package.json, but we're running into a lot of dependency resolution issues, specifically with the ~/* configured to be ./src/*, and pnpm workspace modules....

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