demo · v134 · privacy-sandbox

Race Replayer

Visualise the cross-site reach-measurement race. N worklets fire near-simultaneously, each reads reported=false, all report. Toggle the Web Locks fix and replay — only the first holds the lock, the rest read reported=true and skip.

5
0
worklets fired
0
duplicate reports
0
unique reports

the race

Each worklet does get("reported") then set("reported", true) and reports if the prior value was false. Without ordering, all N gets land before any set commits — they all see false and all report. Cross-site reach numbers inflate by ×N.

With v134's Web Locks integration, the worklet wraps the get/set in navigator.locks.request("reach-lock", ...). The first worklet gets the lock and reports; subsequent worklets queue, then read true and skip. Reach number stays accurate.

see also