A lightweight Firefox add-on to toggle text direction between RTL (Right-to-Left) and LTR (Left-to-Right) seamlessly.
- 🔁 Real-Time Direction Toggle: Switch text direction without reloading the page.
- 🎨 CSS Injection: Force direction changes even on resistant websites using
!important. - 📂 Session Storage: Save settings per tab without bloating local storage.
- 👀 Dynamic DOM Handling: Uses
MutationObserverto handle dynamic content (e.g., SPAs). - ⚙️ Options Page: Exclude specific sites or customize behavior.
- 🚀 Performance-Optimized: Minimal CPU/RAM usage with throttled event listeners.
-
Clone this repository:
git clone https://github.com/logand166/rtl-toggle-pro.git
-
Open Firefox and go to about:debugging.
-
Click "This Firefox" → "Load Temporary Add-on".
-
Select the manifest.json file from the cloned folder.
Method 2: Install Signed Version (Recommended)
Download the .xpi file from Releases.
Drag and drop the .xpi file into Firefox.
🖥️ Usage
Click the add-on icon in Firefox’s toolbar.
Popup Demo
Choose an option:
→ RTL: Force Right-to-Left.
← LTR: Force Left-to-Right.
🔄 Auto: Revert to the website’s default.
Access Settings to:
Exclude domains (e.g., youtube.com).
Toggle advanced options.
🔧 Technical Details
Built With: WebExtensions API, JavaScript, HTML/CSS.
Manifest Version: 2 (Firefox-compatible).
Permissions: activeTab, storage, scripting.
Key Files:
content.js: Handles DOM direction injection.
popup.js: Manages UI interactions.
background.js: Tracks tab states.
options.js: Customizable settings.
🛠️ Development
Fork the repository.
Modify code in the rtl-toggle-pro/ directory.
Test changes using about:debugging.
Submit a pull request!
📜 License
This project is licensed under the MIT License. See LICENSE for details. 🙏 Acknowledgements
Mozilla’s WebExtensions Documentation.
Icons by Font Awesome.
