Repository navigation
fix: allow reo's third-party tracking scripts and stop prefetching the home mark - #432
Open
Jesswinters wants to merge 2 commits into
Open
Jesswinters wants to merge 2 commits into
Jesswinters wants to merge 2 commits into
Conversation
Reo's tag on coder.com has third-party tracking on. It loads the Sitelytics pixel from cdn.sitelytics.tech, which loads Sovrn's pixel from pxdrop.lijit.com, and the docs policy refused both on every page. Their beacons and Sovrn's iframe need no entry, since the policy sets only script-src. coder.com's site policy gets the same hosts in coder/coder-site. Assisted-by: AI
The icon bar's Coder home mark is a fumadocs link item with external set to false, so it renders through Next's Link. On coder.com the docs and the main site share an origin, so Next treats https://coder.com/ as a page of the docs app and prefetches it, which answers 404 for /__next._tree.txt in every reader's console. DocsProvider now gives fumadocs a framework link that renders a full URL as a plain anchor and keeps Next's Link for paths. Fumadocs already renders full URLs it marks external as plain anchors, so only items that opt out reach this branch. Assisted-by: AI
Jesswinters
requested a deployment
to
docs-preview
December 4, 2026 18:33 — with
GitHub Actions
Waiting
Jesswinters
requested a deployment
to
docs-preview
December 4, 2026 18:36 — with
GitHub Actions
Waiting
Jesswinters
requested review from
Lisa-Fiander and
nickvigilante
and removed request for
nickvigilante
December 4, 2026 18:43
Jesswinters
marked this pull request as ready for review
December 4, 2026 18:44
This branch is waiting to be 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.
Needs security sign-off (Lisa or JD): this adds two third-party script origins to the public docs policy. They apply only with
DOCS_ANALYTICSon, like the rest ofANALYTICS_SCRIPT_ORIGINS.Merge order
Either order. The coder.com side is coder/coder-site#114, which adds the same hosts to the site's policy. On coder.com that policy replaces the router's for
/docs. This PR keeps the router's own policy matching it.Summary
This fixes two console errors every reader sees on coder.com/docs. Reo's tracking scripts are refused by the policy, and the "Coder home" mark in the icon bar makes Next prefetch coder.com's home page as if it were a docs page, which returns 404 on
/__next._tree.txt.Fix
CSP (
fix(docs-config)). Reo's tag has third-party tracking turned on. It loads the Sitelytics pixel fromcdn.sitelytics.tech, which then loads Sovrn's pixel frompxdrop.lijit.com. Both are now inANALYTICS_SCRIPT_ORIGINS. Their beacons, Sovrn's iframe andaqfer.lijit.com(loaded inside that iframe) need no entry, because the policy sets onlyscript-src. Marketing hasn't yet confirmed they use Reo's third-party tracking. If they turn it off in Reo instead, this commit can be reverted.Home mark prefetch (
fix(docs-next)).homeLinkItemsetsexternal: falseso the mark opens in the same tab, and that makes Fumadocs render it with Next'sLink. On coder.com the docs and the main site share an origin, so Next treatshttps://coder.com/as a page of the docs app and prefetches it.DocsProvidernow passes Fumadocs a frameworkLink(components.Link, Fumadocs' own extension point) that renders a full URL as a plain anchor and keeps Next'sLinkfor paths. Fumadocs already renders full URLs it treats as external as plain anchors (withtarget="_blank"), so only items that setexternal: falsereach the new branch. Today that's only the home mark. Its markup, styling and same-tab behaviour are unchanged.I tried and dropped a jsdom test that clicks the mark: under node,
next/linkresolves to the pages-router build with no app router mounted, so it never intercepts the click, and the test passed on the old code too. The new tests checkdocs-link's rendered output with a stand-in for Next'sLink, plus the provider wiring.QA
There's nothing to check on the preview. Previews leave
DOCS_HOME_URLunset, so they have no home mark, andDOCS_ANALYTICSoff, so they have no tags. After this deploys to production, in Chrome or Firefox:cdn.sitelytics.techorpxdrop.lijit.com.__next._tree. Expected: no request tohttps://coder.com/__next._tree.txt(requests under/docs/are the docs' own and are fine).Pages to compare
__next._tree.txt404; the home markTesting
docs-link.test.tsxfailed (no module) before the change.pnpm testpasses indocs-next(515) anddocs-config(112), and the router tests pass.pnpm typecheckpasses (19 tasks).pnpm lintpasses, and the pre-commit hook ran on both commits.DOCS_BASE_PATH=/docsandDOCS_HOME_URLset to the serving origin, loaded in Chromium. Onmain, the page requested/outside/docs, which is Next's prefetch of the home mark. On this branch it requested nothing outside/docs, and clicking the mark did a full page load to the main site./docsand/docs/install. With the live policy as is, both pages logged thecdn.sitelytics.techand thenpxdrop.lijit.comrefusals. I found the chain by recording call stacks on script insertion, which point tostatic.reo.dev/…/reo.js.Upstream
No. Fumadocs works as documented:
external: falsemeans an app link. The prefetch comes from our setup, where the docs app and the main site share an origin.🤖 Built with AI assistance.