fix(extension): stateless SW, pull tab state instead of ports (#596)

* feat(extension)!: make sw stateless; tabs update with pulling instead of pushing

* fix(extension): harden tab loading wait

* fix: safer `waitUntil`

* chore: comments

* chore: reduce polling logs
This commit is contained in:
Simon
2026-07-07 21:08:27 +08:00
committed by GitHub
parent 9609592be3
commit 35ff6d44fe
4 changed files with 101 additions and 124 deletions
@@ -64,9 +64,11 @@ export class MultiPageAgent extends PageAgentCore {
},
onBeforeStep: async (agent) => {
// pull latest tab state so that tabs changes can be observed
await tabsController.syncTabs()
if (!tabsController.currentTabId) return
// make sure the current tab is loaded before the step starts
await tabsController.waitUntilTabLoaded(tabsController.currentTabId!)
await tabsController.waitUntilTabLoaded(tabsController.currentTabId)
},
onDispose: () => {