PD
🧩 Plasmo DevelopersSimpleComplex
How do I forward an API request from inside a React component to the BGSW?
Hey all! I'm making an extension that currently has a single content script which loads up a small div using React into the DOM, where a user can enter and submit messages. These messages are sent to an external API, but as I've learned, you need to use the PlasmoMessaging API in order to proxy the request to the BGSW... My only question is, how exactly is that communication done? Can inner-components (.tsx files) easily utilize the chrome / Plasmo API, or do I need to use the base content script (the one that holds & renders my main React component) to utilize these things?
SimpleComplex•51d ago
FYI, thos isn't doable if you want to use something like Axios - have to use raw fetch, afaict.
Also, I figured this out just fine. Will post example or just some more details when I'm not on my phone.
Arcane•51d ago
@SimpleComplex has reached level 1. GG!
SimpleComplex•49d ago
So, no, you don't need to be in the base "content script" file when calling Chrome API / Plasmo API functions - you can be in one of the inner-containers that are rendered within the main content script.
2.1KMembers
View on DiscordWant results from more Discord servers?
More PostsAh, hello there! When it comes toAh, hello there! When it comes to obtaining microphone permissions within a side panel in your PlasmReferenceError: _messaging is not defined while using sendToBackground()I am getting this weird error while trying to use the plasmo messaging package from my content scripHow to do unit testing?I attempted to download and test the `sample` jest, but it did not work due to the following error.
with-supbase github provider link failsso I managed to get the with-supabase example up and running except clicking the github provider takInserting element on click within a Content ScriptHi all, I'm having a React Component that add a click event listener on the body.
When I click on a I have a problem with shadow root - Hide & visibilityhi all ... I have a problem that, I want when I click the Extension icon the shadow root will activaHow do I get Vue devtools to work?I have not been successful in getting Vue devtools to work with Plasmo. I followed the instructions Bug : EAGAIN when use `plasmo package`EAGAIN when using `plasmo package`
```
% yarn package --verbose
yarn run v1.22.22
warning package.jHow to customize parcel config?Hi everyone, I am trying to use a react-native based library called `react-native-reanimated`. This React route is rendered twice when I use useStorage hookHey everyone,
I'm having an issue with my extension. I'm using Plasmo and react-router together.
W