docs: pair <script type="module"> with <script nomodule> fallback - #40
docs: pair <script type="module"> with <script nomodule> fallback#40forgetso wants to merge 1 commit into
Conversation
Ahrefs and other crawlers that don't execute ES module scripts currently skip the Procaptcha bundle entirely on customer pages, so the widget never mounts and the outbound link is never indexed. Google Search Console shows 100+ customer domains linking to prosopo.io; Ahrefs shows zero of them. Updates the recommended snippet in all four EN docs that show the script include so customers ship both a module and a nomodule script tag. The nomodule fallback points at the new IIFE bundle (prosopo/captcha PR for the artifact: prosopo/captcha#2574). Also fixes three snippets that were `<script src="..." async defer>` with no `type="module"` — those were broken against the ES-module bundle that customers actually receive. Translated docs (de, it, pt-br, etc.) reference the same snippet and will need sync via lunaria after this lands. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
✅ Deploy Preview for peaceful-pothos-9e62ce ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
No updates since Nothing is lost — Converting to draft disables auto-merge, so PRs with auto-merge enabled are excluded from this entirely. |
|
No updates since Nothing is lost — Converting to draft disables auto-merge, so PRs with auto-merge enabled are excluded from this entirely. |
Summary
Updates the recommended Procaptcha script-include snippet in the 4 EN doc files that show it. Customers now ship both a
<script type="module">(modern browsers, Googlebot) and a<script nomodule>(Ahrefs, older crawlers, legacy browsers) pointing at the new IIFE artifact.Why
Ahrefs (and other crawlers without ES-module support) currently skip the Procaptcha bundle entirely, so customer integrations contribute zero backlinks. Google Search Console shows 100+ customer domains linking to prosopo.io (printplanet.de: 1 page, twickets.live, pimeyes.com, plus many DR 60+ sites). Ahrefs shows zero of them despite us verifying the link is in the rendered DOM when JS runs.
FriendlyCaptcha already does this — their integration snippet pairs
type="module"withnomodule, which is consistent with their broad Ahrefs backlink coverage on the same client-side-rendered widget pattern.What
src/content/docs/en/basics/index.mdx— main install snippetsrc/content/docs/en/basics/client-side-rendering.mdx— three snippets (head include, implicit-render example, explicit-render example)src/content/docs/en/basics/invisible-captcha.mdx— two snippets (implicit, explicit)src/content/docs/en/demos/client-example-bundle.mdx— bundled-example head includeAlso fixes a side issue: 3 of these snippets had
<script src="..." async defer>withouttype="module". Those were broken against the ES-module bundle customers actually receive (the bundle output starts withimport { a, e, r, b } from "./index-…js", which fails to parse as a classic script). Customers who follow the docs literally would get a parse error; the new snippet works correctly in all environments.Depends on
The IIFE bundle artifact (
procaptcha.bundle.iife.js) needs to exist on the CDN. The build change is in: prosopo/captcha#2574After that PR lands and the artifact is deployed, this doc PR is safe to merge.
TODO (not in this PR)
Test plan
🤖 Generated with Claude Code