v2.4 CURRENT PROTOCOLDOM Hash

DOM Diff Engine

On every check Detector compares the page not as raw HTML but as rendered in a real browser. The decision is made in two layers: the cheap, fast DOM hash layer runs on every check, while the expensive visual diff layer only kicks in if you have turned it on and the hash reported a change. That is why most checks cost $0.002.

1

Render the Page

The page is opened in headless Chromium, the engine waits until network traffic settles (at most 20 seconds), and the final DOM is taken, content built by JavaScript included. If a selector is set, only the selected region is processed from here on.

2

Normalize

Everything that breaks the comparison without carrying meaning is stripped: whitespace differences, script and style tags, attributes carrying session ids, CSRF tokens and the regions your filter rules ignore. The remaining text is split into blocks such as paragraphs, list items and table cells.

3

Compare Block Hashes

A SHA-256 hash is produced for each block and matched against the hash list of the previous accepted version. Added, removed and modified blocks are weighted by text length and turned into a change score between 0 and 1. If every hash is the same, the check ends here and the visual diff does not run.

4

Confirm with a Visual Diff

If visual diff is on, the engine compares the new and old screenshots pixel by pixel and computes the share of the area the difference covers. This layer catches changes that do not show in the DOM: an image being swapped, an element hidden with CSS, an "Out of stock" badge changing colour.

Decision and Thresholds

The final score is the larger of the two layers and is compared with the sensitivity threshold:

SensitivityThresholdWhat it means in practice
low0.15About a seventh of the page has to change
normal0.03A paragraph or a price row is enough
high0.001A single word or digit is enough

When the threshold is crossed, the new version becomes the accepted version and a notification is triggered. Changes below the threshold do not get lost: every check compares the new page with the last accepted version, so a change that creeps in small steps eventually crosses the threshold.

Reading a Check Result

{
  "check_id": "chk_31d0",
  "monitor_id": "mon_8f2c",
  "changed": true,
  "score": 0.042,
  "layers": { "dom": 0.042, "visual": 0.018 },
  "blocks": { "added": 1, "removed": 0, "modified": 2 },
  "cost_usd": 0.01
}
Visual diff raises the per-check cost from $0.002 to $0.01. Turn it on only for pages where a visual change matters (product images, badges).

Next Steps & Guides

Was this guide helpful?

Your feedback helps us improve our documentation.