Sir-Haveri
Sir-Haveri
Explore posts from servers
PD🧩 Plasmo Developers
Created by Sir-Haveri on 10/23/2023 in #🔰newbie
Access env variables with dynamic keys?
I can access process.env['PLASMO_PUBLIC_HELLO'], but not process.env[PLASMO_PUBLIC_${key}], Is there a way to do so in Plasmo?
2 replies
PD🧩 Plasmo Developers
Created by Sir-Haveri on 10/10/2023 in #🔰newbie
Does Plasmo use Chrome API behind the scene?
I'm asking because I would like to build my Plasmo extension for firefox and safari as well. When I use PlasmoStorage API, does it behind the scenes use chrome API? I saw in the official Plasmo docs, that authenticating with Firebase should be done with chrome.identity. How is it possible to do when in Firefox for example? Thanks in advance
4 replies
PD🧩 Plasmo Developers
Created by Sir-Haveri on 9/20/2023 in #🔰newbie
Remove item from storage with Plasmso Storage API?
Is there a way to actually remove an item, beside setting the value to null? Thanks in advance
5 replies
PD🧩 Plasmo Developers
Created by Sir-Haveri on 7/30/2023 in #🔰newbie
Wrapper component for all content scripts?
When using multiple content scripts UI, is there a way to wrap them all in a React component? Thanks
4 replies
PD🧩 Plasmo Developers
Created by Sir-Haveri on 7/26/2023 in #🔰newbie
Trigger a function when opening the Popup?
I know you can create a popup.tsx file, to show JSX when clicking on the extension icon. Is it possible to trigger a function instead of render content, when clicking on the extension icon? For example, when user clicks on the extension icon, instead of showing content in the popup window - trigger a function to change storage state? Thanks in advance
9 replies
PD🧩 Plasmo Developers
Created by Sir-Haveri on 7/2/2023 in #🔰newbie
getStyle API not firing?
I'm using the API in one of my content scripts: export const getStyle: PlasmoGetStyle = () => { console.log('RUNNING); const style = document.createElement("style") style.textContent = styleText return style } But it won't log anything to the conosle, and of course the styles aren't appearing. What could be wrong here? (the content script file does run for sure)
6 replies
PD🧩 Plasmo Developers
Created by Sir-Haveri on 6/11/2023 in #🔰newbie
Using Google Analytics inside content script?
Hello everyone, Nice to be on this forum I'm trying to send Google Analytics events from a content file. First, I verified that the example with-google-analytics is working fine and GA is logging events successfully. Then I switched to the example with-content-scripts-ui, and basically just copied over the content of popup.tsx from the previous with-google-analytics example into the latter example project. I also also added the permission to my package.json: "host_permissions": [ "https://ssl.google-analytics.com", ] However, the events are not firing, and I'm receiving the error: Uncaught Error: Extension context invalidated. And the error: Uncaught (in promise) Error: Cannot find module 'fNtPQ' This error seems to be related to trying to import google tag manager link: import "https://www.googletagmanager.com/gtag/js?id=$PLASMO_PUBLIC_GTAG_ID" Does it mean that remote code cannot be imported in content script context? This link shows how to easily import remote code in a popup: https://docs.plasmo.com/framework/remote-code Can anyone please point me in the right direction? If it's not possible to import remote code in content script, or background script, what is the easiest way to use google analytics in a plasmo app, without using a popup? Thanks a lot in advance everyone
1 replies