Skip to content

Add detector events and the object operator to web detection - #3238

Draft
GuiltyDolphin wants to merge 3 commits into
gd-c-web-detection-waitfrom
gd-c-web-detection-detector-events
Draft

GuiltyDolphin wants to merge 3 commits into
gd-c-web-detection-waitfrom
gd-c-web-detection-detector-events

Conversation

@GuiltyDolphin

Copy link
Copy Markdown
Member

Asana Task/Github Issue: https://app.asana.com/1/137249556945/task/1220838333588628

Description

Builds on #3237.

This lets detectors pass values to each other within a frame:

  • the emit action records a detector event with a name and optional data (any value, kept as evaluated, so an element stays an element and a list is an array). The item has name, timeStamp, detector (the emitting detector's full ID) and data. Detector events never reach EventHub or native
  • detectorEvent bodies on observed, trigger, wait and observe read them by name, like any other recorded type. A name nothing reads or waits on records nothing
  • delivery: events go out once the emitting run ends or suspends in a wait, in the same call stack, in the order they were emitted. Observers with no delayMs run there, as part of the emitting dispatch, and observers with delayMs run on a timer. So a caller that emits a request and waits for the reply resumes in the same task, once the callee has run
  • detectorEventMaxDepth: a run that a detector event starts in the emitting task is one deeper than the emitter. An emit at the cap still records its item and starts delayMs runs, but no runs in the task. Without the setting (or at 0), detector events start no runs in the task. The config build writes the default
  • the object operator gives an object with a field per key, each defined on the object (so __proto__ is a field like any other), computed in order. A failed value fails the object, and a list field is an array of its items

Testing Steps

  • unit tests cover object fields, __proto__, lists and reads through using; observers running after the emitter ends, the item's detector and name, delayMs, the depth cap and the missing setting, observed reading the log, a request and reply resolved in one task and timed as one dispatch (caller, callee, caller resuming), names nothing reads, and parse errors

Checklist

Please tick all that apply:

  • I have tested this change locally
  • I have tested this change locally in all supported browsers
  • This change will be visible to users
  • I have added automated tests that cover this change
  • I have ensured the change is gated by config
  • This change was covered by a ship review
  • This change was covered by a tech design
  • Any dependent config has been merged

🤖 Generated with Claude Code

@github-actions github-actions Bot added the semver-minor New feature — triggers minor version bump label Nov 23, 2026
@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

[Beta] Generated file diff

Time updated: Mon, 30 Nov 2026 12:59:36 GMT

Android
    - android/adsjsContentScope.js
  • android/contentScope.js

File has changed

Apple
    - apple/contentScopeIsolated.js

File has changed

Chrome-mv3
    - chrome-mv3/inject.js

File has changed

Firefox
    - firefox/inject.js

File has changed

Integration
    - integration/contentScope.js

File has changed

Windows
    - windows/contentScope.js

File has changed

@GuiltyDolphin
GuiltyDolphin force-pushed the gd-c-web-detection-detector-events branch from 734618b to 2daf800 Compare November 24, 2026 16:53
@GuiltyDolphin
GuiltyDolphin force-pushed the gd-c-web-detection-detector-events branch from 2daf800 to 504bae4 Compare November 25, 2026 13:15
@GuiltyDolphin
GuiltyDolphin force-pushed the gd-c-web-detection-detector-events branch from 504bae4 to b24920e Compare November 25, 2026 13:28
@GuiltyDolphin
GuiltyDolphin force-pushed the gd-c-web-detection-detector-events branch from 507a337 to 6cc2c61 Compare November 25, 2026 17:46
@GuiltyDolphin
GuiltyDolphin force-pushed the gd-c-web-detection-detector-events branch from 6cc2c61 to 3cfbce7 Compare November 25, 2026 19:18
@GuiltyDolphin
GuiltyDolphin force-pushed the gd-c-web-detection-detector-events branch from 3cfbce7 to 1428f30 Compare November 25, 2026 20:51
@GuiltyDolphin
GuiltyDolphin force-pushed the gd-c-web-detection-detector-events branch from 1428f30 to 7814836 Compare November 25, 2026 21:54
@GuiltyDolphin
GuiltyDolphin force-pushed the gd-c-web-detection-detector-events branch from 7814836 to a8a31a5 Compare November 25, 2026 22:29
@GuiltyDolphin
GuiltyDolphin force-pushed the gd-c-web-detection-detector-events branch from a8a31a5 to ac9a06c Compare November 30, 2026 10:47
GuiltyDolphin and others added 3 commits November 30, 2026 12:28
This adds the emit action, which records a detector event that observed, trigger, wait and observe read by name, and the object operator for building its data. Events are delivered once the emitting run ends or suspends, in the same call stack, so a request's reply resumes its caller in the same task, and runs they start there are capped by detectorEventMaxDepth.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A detector event's run with no delayMs happens in the emitting task, so it's never pending.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
C-S-S matches detector event names by exact string, so the name pattern is an authoring rule, which privacy-configuration CI checks on both emit and detectorEvent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@GuiltyDolphin
GuiltyDolphin force-pushed the gd-c-web-detection-detector-events branch from ac9a06c to 56d9ff9 Compare November 30, 2026 12:57

This branch has not been deployed

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

Labels

semver-minor New feature — triggers minor version bump

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant