Calculate dynamically matches on config

I have a component (.tsx) that needs to calculate dynamically the
matches
matches
property of
config
config
depending on the current tab url.
export const config: PlasmoCSConfig = {
matches: /*SHOULD BE CALCULATED DYNAMICALLY*/
}
export const config: PlasmoCSConfig = {
matches: /*SHOULD BE CALCULATED DYNAMICALLY*/
}
Any idea?
7 Replies
lab
lab•2y ago
If it depends on the runtime tab URL, your best bet is to use bgsw to inspect and inject the script
baru2492
baru2492OP•2y ago
@louis can you please send me an example? I tried a lot of stuff but I can not reach the solution.
lab
lab•2y ago
I'd lookup the docs on executeScript but there's no example for this atm
baru2492
baru2492OP•2y ago
What method should I use to inject the script?
lab
lab•2y ago
You'd use an executeScript call
baru2492
baru2492OP•2y ago
yes, but how should looks the function that will modified the matches prop on config?
lab
lab•2y ago
you will do all of that inside the bgsw instead! - no config at all
Want results from more Discord servers?
Add your server