Firebase auth in background script
I have followed the with-firebase-auth example correctly. Once I sign in in the popup, it seems like auth is persisted to the options page as well, which is great.
However, in the background script I just can't seem to get the auth working. It works for making unauthed Firestore requests though.
This is how I initialize the background script:
...
Calculate dynamically matches on config
I have a component (.tsx) that needs to calculate dynamically the property of depending on the current tab url.
...
matches
matches
config
config
export const config: PlasmoCSConfig = {
matches: /*SHOULD BE CALCULATED DYNAMICALLY*/
}
export const config: PlasmoCSConfig = {
matches: /*SHOULD BE CALCULATED DYNAMICALLY*/
}
Background script missing === creating one for me
I discovered that if I don't include
background.ts, it will create one for me
In Chrome's case it will not be an issue, but in Firefox's case, it also makes it a Service Worker, rather than loading as MV2-style background script
It's worth noting that I specified the dev target as firefox-mv3...Background Keep Alive Fails
@lab Didn't want to crowd the github issue but I'm not able to use the keep alive function:
...
Uncaught TypeError: Cannot read properties of undefined (reading 'runtime')
Uncaught TypeError: Cannot read properties of undefined (reading 'runtime')
ffmpeg wasm cannot load
I'm trying to use ffmpeg wasm to extract audio from a video file at a remote URL. Unfortunately I'm not able to even load ffmpeg. By default, the loader tries to fetch from a CDN, which results in a CORS error for me. I've attempted to go around that by referencing the local file like this:
import ffmpegCoreFile from "url:../vendor/ffmpeg-core.js"
I've tried using this in a background script, through messagings, and in a content script. I am getting a variety of errors depending on the circumstance so I'm wondering: Is this something we have an example for?
I see this error most frequently URL.createObjectURL is not a function which is coming from ffmpeg, but I don't think it's a problem with ffmpeg, and is likely just that I don't understand how to implement this properly in Plasmo. There is a non-Plasmo example of this idea here https://github.com/ffmpegwasm/chrome-extension-app...Can i inject a content script UI at a specific time?
I want to inject some components into the host page using content script UI at a specific time, such as clicking the action icon, how can I control the timing of triggering the injection?
CSUI custom render function create default shadow DOM
I'm following this tutorial: https://docs.plasmo.com/framework/content-scripts-ui/life-cycle#custom-renderer to make a custom renderer. However, I'm getting this error when the call to
createRootContainer() is called (this should make the default shadow DOM:
```
ui.ts:51 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'type')
at injectAnchor (csui.ts:51:14)...How does the service worker hot reload mechanism work?
Hello, hello...
Very impressed with my initial look at Plasmo. Some lovely ideas and implementations in the framework 👏
I have my own internal framework that does many of the things Plasmo does including live reload on all scripts, but I'm blocked in migrating to manifest v3 as I don't know what the mechanics would be to reload a service worker....
tsconfig warning
tsconfig options "importsNotUsedAsValues" and "preserveValueImports" are deprecated. Either set "ignoreDeprecations" to "5.0" in your tsconfig.json to silence this warning, or replace them in favor of the new "verbatimModuleSyntax" flag
tsconfig options "importsNotUsedAsValues" and "preserveValueImports" are deprecated. Either set "ignoreDeprecations" to "5.0" in your tsconfig.json to silence this warning, or replace them in favor of the new "verbatimModuleSyntax" flag

How do I analyze the bundle?
I noticed my app bundle increased from 8mb to 40mb after I installed a couple of deps. Is there a way I can figure out exactly what is causing the larger bundles?
v0.71.0 builds broken
Builds from 0.70.1 work but not in v0.71.0. The error when I load the page:
...
caught SyntaxError: Invalid or unexpected token (at newtab.37e84fdd.js:138:183)
caught SyntaxError: Invalid or unexpected token (at newtab.37e84fdd.js:138:183)
Solution:
This was resolved in 0.71.1, thank you!

react-router HMR Issues when lazy-load
Is HMR working correctly for everyone? I noticed that it's no longer working for me and I have to manually refresh the page each time. The only major change I did was switch to the new React Router 6.4 system: https://reactrouter.com/en/main so it might be that
CSS selector bug
I thought I was going insane
In a popup, apply a sibling selector (
~) , e.g. https://codepen.io/vescoyez/pen/wMyRLP?editors=1100
It appears that Plasmo uses autoprefixer to only apply -moz- selectors, but no prefix-free ones, despite running
```shell
plasmo dev --verbose...
Is it possible to specify per browser permissions?
So, the context around this question is that my extension leverages the
tabGroups API, which isn't available in Firefox, and doesn't seem likely to be implemented for a very long time, but I would still like to be able to release something for Firefox.
I know that I can add logic that only executes code on certain browsers, which is checked at compile-time, but is there anything I can do to have the tabGroups permission (for example) only be requested in compiled manifests targeting a specific browser?...Not seeing background hits with use of relay
Tried out several things to have the relay package hit my BGSW.
Currently attempting this:
```
import type { PlasmoCSConfig } from "plasmo"...
Using @plasmohq/messaging separately?
I have a web app that has a signup/signin process. I want to "sync" the auth state between the extension and the page. I was thinking maybe I can send a relay message from my web app using this package with a content script that's only injected on that webpage and handle it from there. The web app does NOT use plasmo but it's a plain react app, but I was wondering if I can just install the messaging package and use it there.
Is this possible? Any other solution you guys have found?
Thanks!...
Better way to inject scripts that allows file splitting and arguments
hey so i currently have this https://github.com/Tricked-dev/betternexus/blob/master/src/background/index.ts that executes a script but i kinda want to split it in multiple files so i can organize it more but how would i still be able to have it have the config?
Add a custom class to <plasmo-csui>
I find myself needing to add
class="ytp-button" to the <plasmo-csui> so that the element shows correctly where it's injected
With Svelte, of course...Type error on CSUI
I copied and pasted the example (https://docs.plasmo.com/framework/content-scripts-ui/life-cycle#custom-renderer) of the docs and it's throwing errors. Anyone knows how to fix?
(ignore the component error, it does not exist)...
