Universal Text Direction Detector
Free to download on every platform. Comes pre-installed on BotFone, BotPad and BotFlip — with extra free apps included.
About this app
WHAT IT DOES
Universal Text Direction Detector helps you understand the text direction of any webpage by analyzing the actual characters present. The script scans page content using Unicode character range detection and language script analysis to determine whether the page is primarily Left-to-Right (LTR) or Right-to-Left (RTL). A visible indicator shows the detected direction with color-coded badges: blue for LTR, orange for RTL, and green for mixed/bidirectional content. At the block level, the script highlights paragraphs, headings, and other text containers that appear to use a different direction from the page's primary direction. Text that appears misaligned with its detected direction is highlighted, helping you identify potential rendering issues. Statistics show the percentage of RTL and LTR characters on the page, giving you a quantitative understanding of the page's language composition.
WHERE IT RUNS
This script runs on every website (matching all URLs), detecting text direction across the entire web. It works on any page with text content—articles, documentation, blogs, multilingual sites, Arabic and Hebrew language pages, and more. The script automatically adapts to each page and analyzes both static and dynamically loaded content.
HOW TO USE
After installing through the BotGentz extension, simply browse to any webpage. The script automatically detects the page's text direction and displays an indicator in the configuration panel. Use the panel to customize your experience: toggle the direction indicator on or off, show or hide block-level direction detection, enable or disable misalignment highlighting, toggle automatic detection, show or hide statistics, and enable color-coding by direction. The panel displays real-time statistics including percentage of RTL and LTR characters, confidence level, number of blocks with different directions, and misaligned elements count. Use the "Scan Page" button to manually rescan, or the "Test RTL"/"Test LTR" buttons to temporarily switch the page direction for debugging purposes.
UNICODE-BASED DIRECTION DETECTION WITH BLOCK-LEVEL ANALYSIS
This script implements a text direction detection engine using Unicode character range analysis. The engine maintains comprehensive character range tables for RTL scripts (Hebrew, Arabic, Syriac, and related script blocks) and LTR scripts (Latin, Greek, Cyrillic, Armenian, and related blocks). The detection algorithm iterates through text characters, counting occurrences of RTL and LTR characters while ignoring neutral characters like numbers and punctuation. A confidence threshold of 70% determines the primary direction, with a "mixed" classification when both RTL and LTR characters are significantly present. The block-level analysis scans individual text containers (p, div, h1-h6, li, blockquote, etc.) and compares each block's direction against the page-level direction, highlighting deviations. Misalignment detection checks CSS direction and text-align properties against the detected direction, flagging potentially problematic rendering configurations.
THE PANEL
The configuration panel is fully draggable and remembers its position per-site using GM_setValue. It snaps to screen edges when dragged near them, collapses to a compact bubble when minimized, and supports Escape key for quick collapse. All settings—including indicator visibility, block-level detection, misalignment highlighting, auto-detection, statistics display, and color-coding—are persisted across sessions.
PLEASE NOTE
This script requires the free BotGentz extension to run. The script runs on all websites and reads page content to analyze text direction. It does not capture, store, or transmit any personal information. All analysis occurs locally in your browser using GM_setValue. The direction detection is based on character range analysis and may not be 100% accurate for all languages or mixed-script content. The test RTL/LTR buttons temporarily modify the page's CSS direction property and should only be used for debugging purposes. Some websites may have direction-related styles that override the test.