Skip to content

queue toolbar clicks until the relay starts, and show it on the badge - #237

Merged
thdxr merged 1 commit into
devfrom
fix/toolbar-offline
Nov 12, 2026
Merged

thdxr merged 1 commit into
devfrom
fix/toolbar-offline

Conversation

@thdxr

@thdxr thdxr commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

a toolbar click on a normal page while the relay wasn't running gave no feedback, and the clicked tab waited only in memory, so it was lost when the service worker stopped.

what changed:

  • the queue now lives in chrome.storage.session and is restored on worker start, dropping tabs that closed meanwhile
  • a queued tab shows "…" on the toolbar badge, with a title saying browse is waiting for the relay, that it starts when an agent next uses browse, and that a second click cancels
  • a second click cancels the queued one; a take-back queued while offline says the tab will be taken back when the relay connects
  • if the relay turns out to be on another version (or the browser isn't paired), the queued click is dropped and the next click opens the setup page, which says what to do

tests: test/isolated/toolbar-queue.ts covers queueing with the badge and storage, the flush on connect, the restore across a worker restart with a closed tab dropped, the cancel by a second click, the drop on a protocol mismatch, a click landing while the queue is flushed, a queued tab closing, a close during the restore, and a click that wakes the worker before it finds the browser unpaired.

fixes #236

reported by @soultaster, who also suggested persisting the queue in session storage

— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

@thdxr
thdxr force-pushed the fix/toolbar-offline branch from 198acc8 to b0b03d2 Compare November 12, 2026 03:23
clicks wait in chrome.storage.session so a worker stop doesn't lose them, and the badge says "…" until the relay
takes them. a second click cancels. a relay that refuses this browser or speaks another version drops the queue,
because the next click opens the setup page instead.
@thdxr
thdxr force-pushed the fix/toolbar-offline branch from b0b03d2 to 4fcd135 Compare November 12, 2026 03:27
@thdxr
thdxr merged commit 29ebc8e into dev Nov 12, 2026
3 checks passed
@thdxr
thdxr deleted the fix/toolbar-offline branch November 12, 2026 03:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Toolbar click is silent when the relay is not running, and a queued click is lost when the MV3 worker sleeps

1 participant