A lightweight, open source browser extension that natively fixes Right-to-Left (RTL) language formatting (like Hebrew and Arabic) when mixed with English, code blocks, and KaTeX math equations in modern AI chatbots.
Currently officially supports: Claude and Gemini.
- Punctuation marks (
.:?) appear on the wrong side of the sentence - Bullet points and numbered lists indent backwards
- Mixing Hebrew/Arabic with English scrambles the sentence structure
- Standard CSS RTL overrides completely break inline KaTeX math equations and code blocks
This extension uses an optimized, debounced JavaScript MutationObserver. It silently watches the chatbot's text stream in real time. If it detects RTL characters in a paragraph or list item, it dynamically injects a dir="rtl" attribute to fix the grammar and punctuation layout natively.
Simultaneously, a strict CSS layer isolates all <pre>, <code>, and .katex blocks, forcing them into secure LTR "bubbles" so your math and programming syntax remains perfectly untouched.
Since this extension is completely free and open-source, it is not hosted on the official web stores to avoid developer fees.
You can easily install it locally following these instructions
- Go to the Releases page on the right and download the latest release as a zip.
- Open your browser and navigate to the extensions page (e.g.,
chrome://extensions/oredge://extensions/). - Toggle on Developer mode in the top right corner.
- Click Load unpacked and select the extracted
AI-RTL-Fixfolder.
- Go to the Releases page on the right and download the latest release as a zip.
- Open Firefox and type
about:debuggingin the URL bar. - Click This Firefox on the left menu.
- Click Load Temporary Add-on...
- Select the
manifest.jsonfile inside the extracted folder. (Note: Firefox removes temporary add-ons when you restart the browser).
- Go to the Releases page on the right and download the latest release as a zip.
- Open Safari and go to Safari > Settings > Advanced.
- Check the box at the bottom: Show features for web developers.
- In the macOS menu bar, click Develop and check Allow Unsigned Extensions.
- Open your terminal and use Xcode's command line tools to convert the folder into a Safari App Extension by running:
xcrun safari-web-extension-converter /path/to/AI-RTL-Fix- Build the project in Xcode to enable it in Safari. (Note: You must re-enable "Allow Unsigned Extensions" every time Safari restarts).
To prevent CPU spiking during long chats, the DOM MutationObserver is debounced.
It waits for a 50ms pause in the AI's text generation before applying the RTL logic, reducing browser resource usage by over 90% compared to brute force script injection.
The extension is strictly scoped and only activates on claude.ai, gemini.google.com, and chatgpt.com.
Distributed under the MIT License. See LICENSE for more information.
Feel free to fork and modify, or opening a PR!