Repository navigation
Add the observe trigger, observed and trigger sources, and done to web detection - #3235
Draft
GuiltyDolphin wants to merge 2 commits into
Draft
GuiltyDolphin wants to merge 2 commits into
GuiltyDolphin wants to merge 2 commits into
Conversation
Contributor
Build Branch
Static preview entry points
QR codes (mobile preview)
Integration commandsnpm (Android / Extension): Swift Package Manager (Apple): .package(url: "https://github.com/duckduckgo/content-scope-scripts.git", branch: "pr-releases/gd-c-web-detection-observe")git submodule (Windows): git -C submodules/content-scope-scripts fetch origin pr-releases/gd-c-web-detection-observe
git -C submodules/content-scope-scripts checkout origin/pr-releases/gd-c-web-detection-observePin to exact commitnpm (Android / Extension): Swift Package Manager (Apple): .package(url: "https://github.com/duckduckgo/content-scope-scripts.git", revision: "dc4dc9ec46b7caa7ddbe88fbc52d43254408a5ea")git submodule (Windows): git -C submodules/content-scope-scripts fetch origin pr-releases/gd-c-web-detection-observe
git -C submodules/content-scope-scripts checkout dc4dc9ec46b7caa7ddbe88fbc52d43254408a5ea |
Contributor
[Beta] Generated file diffTime updated: Mon, 30 Nov 2026 12:59:32 GMT Android
File has changed AppleFile has changed Chrome-mv3File has changed FirefoxFile has changed IntegrationFile has changed WindowsFile has changed |
This was referenced Nov 23, 2026
GuiltyDolphin
force-pushed
the
gd-c-web-detection-observe
branch
from
November 24, 2026 16:52
efe7b58 to
1dd2826
Compare
GuiltyDolphin
force-pushed
the
gd-c-web-detection-observe
branch
from
November 25, 2026 13:28
3cc9174 to
abd9d37
Compare
GuiltyDolphin
force-pushed
the
gd-c-web-detection-observe
branch
from
November 25, 2026 17:46
abd9d37 to
0f1e61e
Compare
GuiltyDolphin
force-pushed
the
gd-c-web-detection-observe
branch
from
November 25, 2026 19:18
0f1e61e to
652452e
Compare
GuiltyDolphin
force-pushed
the
gd-c-web-detection-observe
branch
from
November 25, 2026 20:50
652452e to
7a16ce6
Compare
GuiltyDolphin
force-pushed
the
gd-c-web-detection-observe
branch
from
November 25, 2026 21:54
7a16ce6 to
a5d452d
Compare
GuiltyDolphin
force-pushed
the
gd-c-web-detection-observe
branch
from
November 25, 2026 22:29
a5d452d to
6589f10
Compare
GuiltyDolphin
force-pushed
the
gd-c-web-detection-observe
branch
from
November 30, 2026 10:46
6589f10 to
d3f3ddd
Compare
…b detection This adds recorders for performance entry types and trusted events, registered at init with captured globals. The observe trigger runs a detector when an item it names arrives, after delayMs or in the listener with sync, and the trigger and observed sources read the arrival and the log over each body's keep window. The done action ends a detector with no match, which releases its recorders. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This sets what an arrival does while a run of the detector is pending: schedule its own run (the default), skip, batch its items into the pending run, or replace it with its own. A batched run's trigger reads each arrival under its own recorder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GuiltyDolphin
force-pushed
the
gd-c-web-detection-observe
branch
from
November 30, 2026 12:57
d3f3ddd to
d639d40
Compare
This branch has not been deployed
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.


Asana Task/Github Issue: https://app.asana.com/1/137249556945/task/1220819267561977
Description
Builds on #3234.
Detectors run only on an
autotimer or a breakage report today. This lets them run when something arrives on the page, such as a click or a batch of long animation frames, and read what arrived:PerformanceObserverper entry type (buffered: true, withdurationThresholdthe lowest any body readingevententries states), and one capture, passive listener per event type and target. Only trusted events are recorded. They usePerformanceObserver,supportedEntryTypesandEventTarget.prototype's listener methods captured when the feature is constructed, and the reader captures the getters of the entry and event prototypesobservetrigger, disabled by default: eachonbody names a type, withdelayMs(default 0) orsync(event bodies only, run in the listener). An arrival schedules a run per detector whoseonbody gives an item from it, and detectors due at the same delay run in one task as one dispatch, reading the page through the frame's read cacheobservedsource reads a recorder's log over the body'skeepwindow (count,withinMs, both, ornullfor everything). A log is kept only while anobservedbody reads it, and drops from the front what no window reaches.keepis required, as the config build writes the defaulttriggersource reads the arrival that started the run, or one item forautoandbreakageReportruns, and gives no items for a body naming another type. Withoutfieldit's a condition leaf, aselementisdoneaction makes the detector done at the end of the run when its value istrueor a list with an item. Adonethat held stays in effect if the run fails later. Once done, itsobservedbodies leave their logs, it stops observing, and a recorder nothing uses any more disconnectstargetis pinned at dispatch, so a run reads it after dispatch even when it's in a shadow treeRecorders register at
init, notload, sinceloadruns on sites where the feature is off. Atargetis evaluated once at registration, and one that isn't an object registers nothing. Atriggerbody reads the recorder anonbody registered and registers none of its own.C-S-S takes any entry type, event type, field and target. What config may use is restricted by the privacy-configuration validator.
Testing Steps
delayMsandsyncruns,whereononbodies,observedwindows, the pinned target,triggerfor other types and forautoand breakage report runs,done(holding, held before a failure, not holding), shared listeners, explicit targets, and entry recorders (threshold, batches, the 104 ms default, unsupported types, disconnecting when done)Checklist
Please tick all that apply:
🤖 Generated with Claude Code