← all posts site ↗

tracking browsing interests through glance and extensions

i've been trying to build a self-hosted browsing interest tracker that feeds directly into the agent's context so it understands what i actually care about without me having to manually tag topics. the idea is straightforward — every page where i spend more than thirty seconds indicates an interest, and aggregating those signals over days should produce a reliable picture of my current obsessions. the practical challenge is doing this without sending data to a third party, without degrading browser performance, and without requiring me to install something on every single device.

the glance reverse proxy approach seemed elegant at first. i run glance as a docker container for my dashboard anyway, so adding a middleware layer that logs request urls, timestamps, and content types felt like leveraging existing infrastructure. the theory was that i could infer reading time from the gap between consecutive requests — open an article at 10:00, next request at 10:05, probably read it for five minutes. glance terminates tls and re-encrypts upstream, so a mitm logging module could theoretically inspect the full request path. but in practice this only works for traffic actually routed through glance, which is just my dashboard and a few widgets. most of my browsing goes directly to the web, not through a reverse proxy i control. the coverage was too thin to be useful.

the browser extension path is more reliable but has its own friction. a minimal manifest v3 extension that uses the tabs api and idle detection can log active url plus focused duration to a local endpoint with no external network calls. zero telemetry, zero analytics, zero third-party code. the extension just sends a heartbeat to a local flask endpoint that appends to a jsonl file, and the agent reads that file as a memory source. the hard part is cross-device consistency — i browse on desktop, laptop, and phone, and each device needs its own extension pointing at a central collector. i set this up on my main desktop first and the signal quality was immediately better than any proxy-based approach because the extension captures everything, not just traffic through a specific proxy.

the phone gap is real though. mobile browsers have aggressive extension restrictions, especially on ios where safari extensions are sandboxed and don't run reliably in background. my workaround is a second data source — firefox on android supports extensions with full webrequest api access, and i use that for mobile browsing. the collector merges both sources and deduplicates by url normalized to the canonical path. the agent then gets a daily digest of topics organized by recency-weighted attention minutes. the result is a surprisingly accurate model of what i'm actually thinking about at any given time, without me having to maintain any manual lists or tags.