feat: add Safari browser support#791
Conversation
Add Safari to the browser tracking definitions so that aw-watcher-web-safari buckets are recognized and queried in the Activity > Browser view. - bundle ID: com.apple.Safari - regex: matches 'Safari' and 'Safari浏览器' (macOS Chinese localization), anchored to avoid false positives (e.g. SafariBrowser) - unit test covering both English and Chinese app name variants Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds Safari support to the browser-bucket matching logic so Safari users’ aw-watcher-web-safari_<hostname> buckets are correctly recognized and included in the Activity > Browser view.
Changes:
- Add Safari bundle ID (
com.apple.Safari) to exact-match browser app names used for window/app correlation. - Add a Safari-specific app-name regex (including macOS Chinese localization variant) to the regex matcher set.
- Add a unit test validating Safari matching (positive and negative cases).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/queries.ts |
Extends browser bucket/app matching to include Safari via exact app name and regex pattern. |
test/unit/queries.test.node.ts |
Adds coverage ensuring the Safari regex matches expected app names and avoids a false positive. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Greptile SummaryThis PR adds first-class Safari browser support to the Activity > Browser view by registering Safari in both lookup maps ( Key changes:
The regex is correctly more strict than several existing patterns (anchored with Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant UI as aw-webui (Browser View)
participant BW as browsersWithBuckets()
participant BE as browserEvents()
participant AW as aw-server query engine
UI->>BW: bid_browsers (list of known bucket IDs)
BW->>BW: _.includes(bucket_id, "safari")<br/>matches "aw-watcher-web-safari_<host>"
BW-->>BE: [("safari", "aw-watcher-web-safari_<host>")]
BE->>AW: query_bucket("aw-watcher-web-safari_<host>")
AW-->>BE: raw tab events
BE->>AW: filter_keyvals(events, "app", ["com.apple.Safari"])
BE->>AW: filter_keyvals_regex(events, "app", "(?i)^safari(浏览器)?$")
AW-->>BE: window events where Safari was active
BE->>AW: filter_period_intersect(tab_events, safari_window_events)
AW-->>UI: browser_events (Safari URLs, domains, titles)
Reviews (1): Last reviewed commit: "feat: add Safari browser support to brow..." | Re-trigger Greptile |
Summary
Safari is not listed in
browser_appnamesorbrowser_appname_regex, soaw-watcher-web-safaribuckets are never matched and the Activity > Browser view always shows "No data" for Safari users.safari: ['com.apple.Safari']tobrowser_appnamessafari: '(?i)^safari(浏览器)?$'tobrowser_appname_regex, anchored to avoid false positives; also covers the macOS Chinese localization (Safari浏览器)Test plan
npm testpasses (14 tests)aw-watcher-web-safari_<hostname>bucket exists with events🤖 Generated with Claude Code