Skip to main content

Module reconstruct

Module reconstruct 

Source
Expand description

Browser-agnostic navigation reconstruction over per-visit BrowserEvents.

Chromium (visits) and Firefox (moz_historyvisits) both record each visit with a visit_id, a from_visit back-reference to the visit that led to it, a normalized transition token, and redirect flags. This module rebuilds the higher-level structure those fields encode:

  • resolve_referrer_chains — follow from_visit to attach each visit’s referrer URL and its depth in the navigation path (bounded, so cyclic or dangling links never loop or panic).
  • redirect_chains / tag_redirect_chains — group the redirect hops between a navigation’s origin and its final landing, tagging each as a client- or server-side redirect.
  • sessionize — group visits into browsing sessions by an idle-gap threshold (a documented, configurable heuristic — sessions are inferred, not recorded) and by any browser-recorded session boundary.
  • tabs_open_at — the set of session tabs whose window was last active at or before a given instant, reusing the SNSS/sessionstore reader output.

Everything reads the attrs the visit parsers already emit and writes new attrs back; missing attrs are treated as “absent” (fail-open — reconstruction never drops or corrupts a visit it cannot fully link).

Structs§

RedirectChain
A reconstructed redirect chain: the origin (when known) followed by its redirect hops, ending at the landing page.
RedirectHop
One hop in a reconstructed redirect chain.
SessionConfig
Configuration for sessionize.

Constants§

DEFAULT_IDLE_GAP_MINUTES
Default idle-gap for sessionize: 30 minutes. A heuristic boundary (sessions are inferred, not recorded by the browser); override via SessionConfig.

Functions§

human_transition_label
A human-readable label for a normalized transition token (the tokens the Chromium/Firefox visit parsers emit). Unknown tokens map to "unknown"; the raw token stays available in the event’s transition attr.
redirect_chains
resolve_referrer_chains
Attach each visit’s referrer URL and navigation-path depth by following from_visit.
sessionize
Group visits into inferred browsing sessions by idle gap.
tabs_open_at
The session tabs whose window was last active at or before t_ns.
tag_redirect_chains
Tag each event that belongs to a redirect chain with redirect_chain_id (usize) and redirect_role ("start"/"hop"/"landing") attrs, via redirect_chains.