Reddit Auto RTL (posts & comments)

Auto-detect RTL text on reddit and set direction/text-align for those blocks (posts, comments, inputs). Works on new.reddit.com and old.reddit.com. Uses MutationObserver for live content.

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

作者
Aboda7m
日安装量
0
总安装量
0
评分
0 0 0
版本
1.1.1
创建于
2025-11-23
更新于
2025-11-23
大小
10.3 KB
许可证
MIT
适用于

Reddit Auto RTL (posts & comments)

Auto-detect RTL text on Reddit and set direction/text-align for those blocks (posts, comments, inputs). Works on new.reddit.com and old.reddit.com. Uses MutationObserver for live content.

Features

  • Detects Arabic and other RTL scripts
  • Applies direction: rtl and text-align: right to posts, comments, titles and input fields when appropriate
  • Preserves inline code and pre blocks so monospace alignment is not broken
  • Live updates for dynamically loaded content
  • Lightweight - no external dependencies

Installation

  1. Install a userscript manager like Tampermonkey, Greasemonkey, or Violentmonkey.
  2. Create a new userscript and paste the contents of reddit-auto-rtl.user.js, or install the raw file if hosted.
  3. Reload Reddit.

Files

  • reddit-auto-rtl.user.js - the userscript file
  • README.md - this file
  • LICENSE - MIT license

Usage

  • The script runs automatically on https://*.reddit.com/*.
  • Input fields automatically flip direction while you type.
  • If a container has an explicit dir attribute, the script will not override it.

Contributing

  • Fork, improve, open a pull request.
  • Keep changes small and focused.
  • If you add tests, include instructions and a test runner.

Changelog

  • 1.1.1 - Metadata updates and minor cleanup (author, license)
  • 1.1 - Initial public release with robust RTL detection and MutationObserver
  • 1.0 - Proof of concept

License

MIT

Author

Aboda7m GitHub: https://github.com/Aboda7m/reddit-auto-rtl