Skip to content

Add Beacon API via navigator.sendBeacon #43

Description

@FlorianRappl

Proposal

Implement navigator.sendBeacon for fire-and-forget telemetry and background-safe submissions.

Scope:

  • Expose navigator.sendBeacon with URL and body inputs.
  • Support string, blob, and byte-like body forms.
  • Return boolean based on acceptance of enqueue/send.
    Technical Notes:
  • Route through requesters/loader with non-blocking semantics.
  • Inject policy for size limits and batching if needed.
    Acceptance Criteria:
  • sendBeacon returns true for accepted payloads and false for rejected ones.
  • Body serialization and content type handling are covered by tests.
  • No unhandled exceptions on unsupported payloads.
    Out of Scope:
  • Browser-specific background delivery guarantees.
  • Retry persistence across process restarts.

Description

Implement navigator.sendBeacon as a lightweight, non-blocking telemetry submission API with body type support and deterministic acceptance behavior.

Background

sendBeacon is widely used for analytics and end-of-session events where fire-and-forget semantics are preferred over fetch/XHR lifecycle coupling.

Specification

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions