Open heavenkiller2018 opened 2 years ago
Try
chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
if (changeInfo.url) {
bridge.send('browserTabUpdated', { tab, changeInfo })
}
})
Hi! I'm also experiencing this issue, it seems that bexBackground's callback function is being called every time the browser is refreshed adding more listeners.
Have you found a workaround for the issue?
I may have found as solution, you can check if the event is already listened using hasListeners()
if (!chrome.tabs.onUpdated.hasListeners()) {
chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
// ...
})
}
What happened?
I followed this instruction to check the communication from background script to Quasar App
[Background Script | Quasar Framework](https://quasar.dev/quasar-cli-vite/developing-browser-extensions/background-script)
background.ts
Quasar App (as iframe form to show on common web page)
then I run these code, I found the event
bex.tab.opened
which should be triggered only once was triggered many times when I opened a new tab.What did you expect to happen?
only be triggered once.
Reproduction URL
https://stackblitz.com/edit/quasarframework-vfcnwa
How to reproduce?
.
Flavour
Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)
Areas
BEX Mode
Platforms/Browsers
Chrome
Quasar info output
Relevant log output
No response
Additional context
No response