You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tech detection: Clarity loaded through next/script in a Next.js flight payload is missed since v0.0.151 (−46 sites) #1477
Since v0.0.151, tech detection misses Microsoft Clarity on Next.js App Router sites whose layout loads the Clarity snippet through next/script. The loader is still in the page: it sits inside the self.__next_f.push([1,"..."]) flight payload, and v0.0.150 found it there.
Measured on our Product Hunt corpus (33,317 sites, the same stored crawls re-detected with each engine):
Engine
Sites with Clarity
v0.0.150
1,328
v0.0.151
1,282
v0.0.152
1,282
I sampled 8 of the 46 sites. On all 8 the hit is in a flight script (self.__next_f.pu…, both under and over 16 KB). On 5 I read the masked text around it, and it's the standard loader, t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i. So these are real installs, not mentions.
The likely cause is #1437 (34f527c), "read only the script elements of a Next.js flight script, not its whole text". The same change correctly dropped vendors that only appear as prose, links or env values in the flight payload: PostHog −19, Square −12 and Vue −34 are almost all privacy-policy text, links and blog content. That part should stay.
Expected
A Clarity loader rendered with next/script, whether as inline children or as dangerouslySetInnerHTML.__html, inside the flight payload is detected, as it was in v0.0.150.
Acceptance Criteria
A fixture of a Next.js App Router page whose layout renders the Clarity loader through next/script, with the flight payload split over several <script> chunks, detects clarity.
On the PH corpus re-detect, the Clarity count is back to v0.0.150's (1,328 on the 33,317 common sites, give or take 5), with no new PostHog, Square or Vue detections from prose.
amended 2026-11-02: on the 34,968 sites common to both runs, v0.0.159 keeps 1,397 of v0.0.150's 1,400 Clarity detections (at least 99.7 percent) and none of its detections comes from prose; the "1,328 on 33,317 sites" figure was measured on an older set of sites and is not comparable.
Corpus evidence for the fix in #1480 (head 34b50eeb), recorded here: a 33-shard run over 19,141 sites. The change recovers Clarity on 38 of the 47 sites that lost it, with 0 losses, and the prose drops for PostHog, Vue and Square are unchanged. The estimated full-corpus count is about 1,320 against 1,328 on v0.0.150.
What remains of the 9 not recovered: 1 double-escaped flight shape, 5 installs inside a first-party bundle (these need a detector over the bundle, follow-ups are coming), 1 loaded only after consent, and 2 correct drops. The acceptance count of 1,328 within 5 is not met yet (8 short), so this issue stays open.
Checked against main (e86767f) and the v0.0.159 corpus run (masked, by squirrelscan-53). Ticked criteria 1 and 2 and the corpus criterion, which is amended (original kept visible). Criteria 1 and 2: packages/tech-detect/tests/flight-script-narrow-1437.test.ts passes (58 tests, bun 1.4.0): it holds the #1477 cases (a long next/script snippet in a flight text row, split over chunks, children and dangerouslySetInnerHTML.__html) and the #1437 negatives (vendor only in content, prose, links). Corpus, same stored crawls, 34,968 sites common to both runs: Clarity v0.0.150 1,400, v0.0.151 1,353, v0.0.159 2,096; v0.0.159 keeps 1,397 of v0.0.150's 1,400 and adds 699 (#1489, #1490); 44 of the 47 sites v0.0.151 lost are back. The 3 sites not kept were read and are correct drops (cookie and privacy prose in the flight payload that mentions clarity.ms). Of the sites #1437 dropped, v0.0.159 re-detects PostHog on 1 (a real init config with an api host in the flight payload, not prose), Square on 0 and Vue on 0. The earlier figure of 1,328 on 33,317 sites was measured on a different set of sites, hence the amendment. Closing.
Activity
fix(tech-detect): read a long next/script snippet that a Next.js flig…
fix(tech-detect): emit a flight text row once and cap the emitted tex…
fix(tech-detect): emit a flight text row once and cap the emitted tex…
nc9 commentedon Nov 1, 2026
Corpus evidence for the fix in #1480 (head
34b50eeb), recorded here: a 33-shard run over 19,141 sites. The change recovers Clarity on 38 of the 47 sites that lost it, with 0 losses, and the prose drops for PostHog, Vue and Square are unchanged. The estimated full-corpus count is about 1,320 against 1,328 on v0.0.150.What remains of the 9 not recovered: 1 double-escaped flight shape, 5 installs inside a first-party bundle (these need a detector over the bundle, follow-ups are coming), 1 loaded only after consent, and 2 correct drops. The acceptance count of 1,328 within 5 is not met yet (8 short), so this issue stays open.
nik
fix(tech-detect): read a long next/script snippet that a Next.js flig…
fix(tech-detect): emit a flight text row once and cap the emitted tex…
nc9 commentedon Nov 2, 2026
Checked against main (e86767f) and the v0.0.159 corpus run (masked, by squirrelscan-53). Ticked criteria 1 and 2 and the corpus criterion, which is amended (original kept visible). Criteria 1 and 2:
packages/tech-detect/tests/flight-script-narrow-1437.test.tspasses (58 tests, bun 1.4.0): it holds the #1477 cases (a long next/script snippet in a flight text row, split over chunks, children anddangerouslySetInnerHTML.__html) and the #1437 negatives (vendor only in content, prose, links). Corpus, same stored crawls, 34,968 sites common to both runs: Clarity v0.0.150 1,400, v0.0.151 1,353, v0.0.159 2,096; v0.0.159 keeps 1,397 of v0.0.150's 1,400 and adds 699 (#1489, #1490); 44 of the 47 sites v0.0.151 lost are back. The 3 sites not kept were read and are correct drops (cookie and privacy prose in the flight payload that mentions clarity.ms). Of the sites #1437 dropped, v0.0.159 re-detects PostHog on 1 (a real init config with an api host in the flight payload, not prose), Square on 0 and Vue on 0. The earlier figure of 1,328 on 33,317 sites was measured on a different set of sites, hence the amendment. Closing.nik