Show roach-motel and webdriver-probe detections in the popup#129
Merged
Conversation
Both rules currently land their findings only as sr-only landmarks — visible to agents but invisible to sighted users. Add a "Detected on this page" section to the browser-action popup and tint the toolbar badge amber on tabs with detections so the human user sees what was flagged. Rules emit a typed `rule-detection` message after stamping the landmark; the existing landmark-already-present short-circuits act as per-document dedupe latches. The background keeps a per-tab record alongside `tabCounts`, cleared on navigation, tab close, and when the producing rule is toggled off mid-session. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Only render the popup section when there is at least one detection, and use "Heads up" as the heading. The prior "Detected on this page" copy implied a full audit of rule activity when really it only covers the informational annotations from roach-motel and webdriver-probe. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
roach-motel-annotateandwebdriver-probe-annotateflagged on the active tab.!when there's no placeholder count to anchor on, otherwise keeps the existing count text.Why
Today both rules surface their findings only as
sr-onlylandmarks in the accessibility tree — readable to agents but invisible to sighted users. The popup had no per-tab activity view and the badge only counted placeholders, so a roach-motel hit or anavigator.webdriverread on the current page produced zero human-visible signal.Approach
rule-detectionmessage right after stamping its landmark. The existing landmark-presence short-circuits double as per-document dedupe latches, so no separate flag is needed.background.tskeeps aMap<tabId, Map<DetectionKind, DetectionPayload>>alongside the existingtabCountsmap. A unifiedrefreshBadge(tabId)reads both signals and picks color + text. Detections are cleared ontabs.onUpdatedstatus: "loading",tabs.onRemoved, enforcement-off, and rule-disable transitions viaruleStatesStorage.subscribe.get-tab-detectionsmessage; the hook staysnulluntil the runtime fetch resolves so the empty state doesn't flash on tabs that actually have detections.hidden-text-stripand CSP-strict sites out of the picture.Out of scope
tabDetectionstochrome.storage.sessionso SW restarts don't lose state (in-memory matchestabCountsposture today).Test plan
bun run typecheck,bun run check,bun run knip,bun run build,bun run test(1005 tests pass).extension/dist, visithttps://www.nytimes.com/subscription/all-access, open popup → roach-motel entry appears with host, difficulty, cancellation link, source; badge is amber.roach-motel-annotateoff → entry disappears; badge reverts to blue (or empty) when there's no placeholder count.webdriver-probe-annotateon, reload a probing page → webdriver-probe entry appears.🤖 Generated with Claude Code