🧩 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

Remix production cannot sendToBackgroundViaRelay

I use a SAAS of remix at https://github.com/dev-xo/remix-saas/tree/main/docs and intergrate with plasmo extension with sendToBackgroundViaRelay so that i can proxy my apis call from web to extension ```tsx // on index.tsx export default function DashboardIndex() { const { t } = useTranslation()...

how do you change the styling of a page or inject your UI in it.

so I am trying to inject into the youtube secondary div or something but badly failing it, in the content.jsx file.

Refused to evaluate a string as JavaScript

Hello, I'm trying to use Vue with the Vuelidate library to validate my inputs, but when I try to validate it gives me the error: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' http://localhost". How would I go about resolving this?...

Error when upgrading from 0.55 to 0.88

I'm upgrading from v0.55 to latest version 0.88.0, then i run pnpm dev --verbose and got this error. Can anoyone help me sovle this? EISDIR: illegal operation on a directory, read...
No description

Get tab id in side panel for both Chrome and Firefox?

I've been getting the tab id by running this code in the side panel when it's loaded: ``` const tabIdRes = await chrome.tabs.query({ active: true, currentWindow: true...

Error building extension

Hi all. After having been able to successfully build our extension for weeks, we have started to encounter the below error during the build process. We have tried variously bumping node versions up and down, swapping all plasmo-related package versions, etc., to no avail. Any help or insight appreciated....
No description

Issue testing code with plasmo/storage dependancies with Jest

The dependancy that plasmo/storage has on pify causes any jest tests that touch that code to fail with an error Jest encountered an unexpected token ...

Any tips to speed up `plasmo build` build times?

There are times I find myself developing and building my extension using plasmo build instead of plasmo dev in sessions where I need to do lots of code edits, and I don't want the hot-reload firing on every file save - which results in increased CPU load on my machine. But as you can see in the screenshot the builds can take up to 9-13 seconds - not the best when in the flow of things. Are there any ways I can improve this? ...
No description

Build config

Is there a build hook? I want to clear all console.log() related code in the code when building the project file.

Execute csui conditionally

Hi! Q1: How can I invoke chrome.scripting.executeScript, with the files argument, I mean how do I reference the file, let’s suppose I want to execute a script that it’s in src/scripts/customScript.ts. I’ve tried passing the relative path but it doesn’t seem to work. Q2: how can I trigger a CSUI only when a certain action happened (conditionally) (context; In my case only if I received a specific websocket message.) ...

How to use react-select in content script ui

Hi! I am trying to use react-select to display a more complex dropdown in CSUI, but styles are not correctly injected in the shadow dom. I need some help figuring this out, how could I fix the styling for external components. Any help is greatly appreciated!...

Main World Content Script not working on localhost

I've created an extension using plasmo, with default code ``` export const config: PlasmoCSConfig = { matches: ["<all_urls>"], world: "MAIN"...
Solution:
Solved Was able to solve it by modifying the manifest in package json. Updated manifest : ``` "manifest": { "host_permissions": [...

How to inject content.tsx into the opened tab when installing or updating the plugin

When installing or updating the plugin, you can directly inject content.tsx into the opened tab page. Now you need to refresh the original web page.

How can I override the extension action behaviour to show a CSUI instead.

background.ts ``` chrome.action.onClicked.addListener((tab) => { chrome.sidePanel.open({ windowId: tab.windowId }); });...

"Uncaught ReferenceError: importScripts is not defined"

i get this when importing a component but works otherwise content script ui...

how to reuse components in from existing nextjs project

i created a plasmo project within an existing next js directory so that i could reuse some components from the src/app dir that next js uses but whenever i import i get "invalid hook" error something about react being called twice? but if i copy the component i want to reuse even though, it also imports from the src/app for child components it works fine....

How to fix "WARN | Unable to find any entry files. The extension might be empty"

Hi, I keep having this error after keeping the project inactive for a while, anyone face this problem before? The extension event cannot be clicked now and I guess this is the issue. My project is newly created without heavy content. only a simple content.tsx react component and a popup.tsx. Thanks

Webpage with an element called 'process' broke Plasmo framework.

Hello, I faced a weird situation, that the runtime crashed due to an element called 'process' on a webpage. and that caused a undefined error, so all the rest stopped working. How can I solve this? I tried everything on the content script but of coz the runtime executes way before it so it won't work.
No description

AudioWorklet not loading in CSUI, works in popup

Hey guys, I'm having an issue using AudioWorklet in the context of Content Script UI. We're having trouble connecting our audio processor (with worklet.addModule) in our CSUI component (but not in our popup.tsx)....