Skip to content

v0.1.6

@bill9109 bill9109 tagged this 25 Sep 03:34
Every tab runs its own copy of this plugin, so an event used to be announced
once per open tab, and only the browser's same-tag replacement hid the
duplicates afterwards.

- a tab that is visible AND shows the event's session suppresses that session's
  notifications everywhere — the user is already looking at it
- otherwise the tabs elect one announcer: visible pages first, then the lowest
  page id, so every tab agrees without a negotiation round; the other candidates
  wait 600ms for the elected tab's "shown" broadcast and take over when a frozen
  or discarded tab never reports back
- keys already shown are remembered across pages and across a reload, so a
  still-pending approval or question is not re-announced by a refreshed page or a
  newly opened tab; a session's completion reminder re-arms when its flag drops
- each page announces its view (tab visibility, shown session, notification
  permission) over a BroadcastChannel; browsers without one keep the previous
  single-page behaviour

Tests: 34 specs, adding multi-page elections, the visible-tab suppression, the
visible-tab-on-another-session case and reload de-duplication.
Assets 2
Loading