Skip to content

fix: obfuscation bug on Firefox - #401

Merged
coston merged 2 commits into
masterfrom
fix/397-obfuscation-bug-on-firefox
Oct 24, 2026
Merged

coston merged 2 commits into
masterfrom
fix/397-obfuscation-bug-on-firefox

Conversation

@coston

@coston coston commented Oct 24, 2026

Copy link
Copy Markdown
Owner

Description

On Firefox, obfuscated links rendered backwards (and unreadable) until the user hovered over them, while Safari, Chrome, Edge, and Opera displayed them correctly from the start.

The obfuscation technique reverses a link's text and applies direction: rtl; unicode-bidi: bidi-override; so the reversed DOM text displays correctly to a human. bidi-override is a non-isolating CSS bidi embedding, and per the Unicode Bidi Algorithm an embedding lets the browser's bidi resolution bleed across the embedding's boundary into surrounding sibling content — different engines resolve that bleed differently, which is why Firefox showed the obfuscated text (and sometimes neighboring content) reversed until a hover-triggered re-render corrected it.

The fix switches unicode-bidi from bidi-override to isolate-override, which keeps the override behavior inside the element but isolates it from surrounding content, preventing the bleed. It's supported in Firefox since version 50 (2016), so there's no compatibility cost.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the code style of this project.
  • If my change requires a change to the documentation I have updated the documentation accordingly.

Testing

  • npm run lint — passed
  • npx jest --coverage — 21/21 tests passed, 100% coverage maintained

Related Issue

Fixes #397

…rrounding text

bidi-override is a non-isolating bidi embedding, so Firefox and Chromium can
resolve its interaction with adjacent DOM content differently, which is why
obfuscated links can render reversed/garbled on Firefox until a hover
re-triggers layout. isolate-override keeps the override contained to the
obfuscated element itself, matching the CSS Writing Modes spec's recommended
replacement for this exact class of bug.

Resolves #397
#397
@vercel

vercel Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
react-obfuscate Ready Ready Preview Oct 24, 2026 11:31pm UTC

Request Review

@coston
coston merged commit 6cfc86c into master Oct 24, 2026
3 checks passed
@coston
coston deleted the fix/397-obfuscation-bug-on-firefox branch October 24, 2026 23:35

This branch was successfully deployed

1 active deployment
Preview — 8e1b665e Deployed Oct 24, 2026 by vercel[bot]
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.

Obfuscation bug on Firefox

1 participant