Fix RTL Arabic/Hebrew/Farsi/Urdu text direction in Codex Desktop, Claude Desktop, Claude Web, Antigravity, and Electron AI apps across app versions.
Event-driven RTL injection through the Chrome DevTools Protocol.
Fix Arabic/Hebrew/Farsi/Urdu direction in desktop AI apps without editing app.asar.
Current profiles:
- ChatGPT / Codex Desktop RTL fix (supports new
ChatGPT.exeexecutable and legacyCodex.exe) - Claude Desktop RTL fix (experimental; some MSIX builds may block CDP launch flags)
- Claude Web RTL fallback (recommended when Claude Desktop blocks CDP)
- Antigravity RTL fix
- Custom Electron/Chromium apps that accept
--remote-debugging-port
أداة خفيفة لإصلاح اتجاه النص العربي/العبرية/الفارسي/الأردو في تطبيقات Electron مثل Codex Desktop وClaude Desktop وAntigravity بدون تعديل ملفات التطبيق.
الفكرة: نشغل التطبيق مع منفذ DevTools محلي، ثم نحقن سكربت RTL عند بداية كل صفحة عبر Chrome DevTools Protocol. العربي يبدأ من اليمين حتى لو فيه رموز أو كلمات إنجليزية، بينما الكود والتيرمينال يظلان LTR.
لا يوجد polling للـ DOM كل عدة ثوان. الحقن يعتمد على أحداث Chromium، وداخل الصفحة يستخدم MutationObserver عند تغيّر الواجهة فقط.
ملاحظة مهمة عن Claude: بعض نسخ Claude Desktop من Microsoft Store/MSIX قد تُغلق عند تشغيلها مع --remote-debugging-port قبل أن يستطيع هذا المشروع الاتصال بها. في هذه الحالة استخدم Start-Claude-Web-RTL.bat، وهو يفتح Claude Web داخل نافذة Edge/Chrome مستقلة ويطبق نفس إصلاح RTL بدون تعديل ملفات Claude.
هذا يفيد لما تبحث عن:
- حل مشكلة العربي في Codex Desktop
- إصلاح RTL في Claude Desktop أو Claude Web
- جعل العربي يبدأ من اليمين في Antigravity
- حل اتجاه العربية مع الإنجليزي والرموز
- إصلاح RTL بدون تعديل
app.asar
This project was created after direct app.asar patching proved fragile for Microsoft Store/MSIX apps. It does not edit app files. Instead, it launches the official app with a local DevTools Protocol port and registers an RTL script with Page.addScriptToEvaluateOnNewDocument.
Electron apps expose Chromium renderers. When launched with --remote-debugging-port, those renderers can be controlled through CDP.
The injector:
- Starts the target app with a local CDP port.
- Connects to the browser WebSocket.
- Enables target discovery and auto-attach.
- Registers the RTL patch as a new-document script.
- Injects into already-open renderers once.
- Waits for Chromium target events.
There is no timer that repeatedly scans the app from the outside. Inside the page, the RTL patch uses MutationObserver, so it runs only when the UI changes.
Use one of the launchers:
launchers\Start-Codex-RTL.bat
launchers\Start-Claude-RTL.bat
launchers\Start-Claude-Web-RTL.bat
launchers\Start-Antigravity-RTL.batThe desktop launcher restarts that app so the DevTools port can be enabled.
If Claude Desktop closes immediately or the injector log says CDP did not become available, use:
launchers\Start-Claude-Web-RTL.batThe Claude Web fallback opens Claude Web in an isolated Edge/Chrome app-mode profile, then attaches the same RTL injector to that browser instance.
For daily use without a visible terminal window, use:
launchers\Start-Codex-RTL-Hidden.vbs
launchers\Start-Claude-RTL-Hidden.vbs
launchers\Start-Claude-Web-RTL-Hidden.vbs
launchers\Start-Antigravity-RTL-Hidden.vbs
To stop hidden injector processes:
launchers\Stop-RTL-Injectors.batThe target app can stay open. Already-injected pages keep their RTL behavior; keeping the injector running lets it handle new windows/reloads.
Launcher variants:
.bat: visible terminal, useful for debugging logs.-Hidden.vbs: no visible terminal, better for daily use.Stop-RTL-Injectors.bat: stops hidden/background injector processes.
Start-Claude-RTL.bat attempts to launch the official Claude Desktop app with CDP enabled. This only works if that Claude Desktop build accepts --remote-debugging-port.
Some observed Microsoft Store/MSIX builds exit when launched with CDP flags. When that happens, the injector never reaches the DOM, so changing CSS selectors or the RTL script will not fix Desktop injection.
Use Start-Claude-Web-RTL.bat as the reliable fallback. It opens Claude Web in a separate browser profile with a local DevTools port, then injects the same RTL patch.
If you know a reliable Claude Desktop-specific fix, please open an issue or pull request with the Claude version, install type, Windows version, launch command, CDP test result, and relevant log lines.
Codex Desktop RTL fix, Codex Arabic RTL fix, Codex Arabic text starts from left, Claude Desktop RTL fix, Claude Web RTL fix, Claude Desktop Arabic RTL, Antigravity RTL fix, Antigravity Arabic RTL, Electron Arabic text direction fix, RTL fix without modifying app.asar, Arabic mixed English symbols RTL fix, Chrome DevTools Protocol RTL injection, Page.addScriptToEvaluateOnNewDocument RTL.
Arabic: حل RTL في Codex Desktop، إصلاح العربي في كودكس، حل اتجاه الكتابة العربية في Claude Desktop، إصلاح العربي في Claude Web، إصلاح العربي في Antigravity، جعل العربي يبدأ من اليمين، حل مشكلة العربي مع الإنجليزي والرموز، حل RTL بدون تعديل app.asar.
More phrases are in docs/KEYWORDS.md.
Related projects and prior art are listed in docs/PRIOR_ART.md.
node .\src\desktop-rtl-injector.js --app codex --restart
node .\src\desktop-rtl-injector.js --app claude --restart
node .\src\desktop-rtl-injector.js --app antigravity --restartClaude Web fallback:
launchers\Start-Claude-Web-RTL.batCustom app:
node .\src\desktop-rtl-injector.js --app codex --exe "C:\Path\To\App.exe" --process-name App.exe --port 9339 --restartExplicit app paths:
$env:CODEX_RTL_EXE="C:\Path\To\Codex.exe"
$env:CLAUDE_RTL_EXE="C:\Path\To\claude.exe"
$env:ANTIGRAVITY_RTL_EXE="C:\Path\To\Antigravity.exe"
$env:CLAUDE_WEB_BROWSER_EXE="C:\Path\To\msedge.exe"- Windows
- Node.js 22+
- Electron/Chromium app that accepts
--remote-debugging-port
The injection mechanism is not tied to one app version. It should work across app updates as long as:
- the app still uses Electron/Chromium,
- it still accepts
--remote-debugging-port, - its message DOM still contains normal text elements.
The included Codex and Claude launchers auto-detect the newest matching Microsoft Store/MSIX package at runtime through Get-AppxPackage. Observed/tested versions and known blockers are listed in docs/SUPPORT.md.
Antigravity defaults to %LOCALAPPDATA%\Programs\Antigravity\Antigravity.exe. If your install path is different, set ANTIGRAVITY_RTL_EXE or pass --exe.
The DevTools Protocol port is bound to 127.0.0.1. Do not expose it to the network.
Close the injector window to stop listening for new Chromium targets. Open the app normally to run without RTL injection.
MIT
963f57c (fix(codex): support ChatGPT.exe executable rename and add fallback resolution)