Skip to content

fix(site): stop Cloudflare rewriting the CDN snippet as an email address - #41

Merged
killerwolf merged 1 commit into
mainfrom
fix/cf-email-obfuscation
Sep 7, 2026
Merged

fix(site): stop Cloudflare rewriting the CDN snippet as an email address#41
killerwolf merged 1 commit into
mainfrom
fix/cf-email-obfuscation

Conversation

@killerwolf

Copy link
Copy Markdown
Owner

Caught while verifying the deploy of #40.

The bug

The install snippet went live on h4md1.fr/visual-image-tool/ reading:

https://cdn.jsdelivr.net/npm/@h4md1/[email protected]/dist/visual-image-tool.umd.js

Cloudflare proxies h4md1.fr, and its Email Address Obfuscation feature matched visual-image-tool@0.3.0 as an email address — replacing it with a mailto-decoding <a class="__cf_email__"> and injecting email-decode.min.js.

So the one snippet on the page whose entire job is to be copied produced a dead URL.

The gh-pages branch was byte-identical to the local file; the rewrite happens at Cloudflare's edge, after GitHub serves it. Diffing served-vs-deployed is what surfaced it:

655c655
<   ...npm/@h4md1/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" ...>[email protected]</a>/dist/...
---
>   ...npm/@h4md1/visual-image-tool@0.3.0/dist/...

It only appeared once the version was pinned — the previous @0.2 has a single dot and didn't look domain-like enough to match.

The fix

Wraps the block in Cloudflare's documented <!--email_off--> opt-out, which works from the page itself with no dashboard access.

h4md1.fr/QuickToss/ was checked and is unaffected — zero __cf_email__ occurrences, no email-shaped text on it.

🤖 Generated with Claude Code

The landing page's install snippet went live reading

  https://cdn.jsdelivr.net/npm/@h4md1/[email protected]/dist/...

Cloudflare proxies h4md1.fr, and its Email Address Obfuscation feature
matched "visual-image-tool@0.3.0" as an address, replacing it with a
mailto-decoding <a> and injecting its email-decode script. Anyone copying
the CDN line got a dead URL — the one snippet on the page whose entire job
is to be copied.

It only appeared once the version was pinned: the previous "@0.2" has a
single dot and didn't look domain-like enough to match.

Wraps the block in Cloudflare's documented email_off opt-out, which works
from the page without touching the dashboard.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@killerwolf
killerwolf merged commit e180cca into main Sep 7, 2026
2 checks passed
@killerwolf
killerwolf deleted the fix/cf-email-obfuscation branch September 7, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant