Help: chrome.scripting.executeScript executes only once
Hey guys, I need help with the below code. I have created a popup with a button that calls the below mentioned handleClick function which executes the function foo from foo.ts
The code works but it is executed only for the first button click. I see "bar" logged in the console window but nothing happens on further clicks.
popup.tsx:
import foo from "url:~scripts/foo.ts"
const handleClick = async () => {
const [tab] = await chrome.tabs.query({ active: true, currentWindow: true })
await chrome.scripting.executeScript({
target: {
tabId: tab.id
},
world: "MAIN",
files: [foo.split("/").pop().split("?")[0]]
})
}
src/scripts/foo.ts:
function foo() {
console.log("bar")
}
foo()
2.1KMembers
View on DiscordWant results from more Discord servers?
More PostsWeb Workerhey im working with a web worker and it seems to be huge in dev but much smaller in the prod build. Certainly! To bundle a resource withCertainly! To bundle a resource with Plasmo, you can utilize tools like Webpack or Parcel to packageIntegrating Web Authentication with Plasmo ExtensionI'm new to Plasmo and currently working on creating a Vue extension. My web application utilizes CleUsing Stripe and setup an API inside the extensionHello !
I am able to make queries to stripe using what was explained on the website :
https://doc