This app runs inside the BotSurf browser. Don't have it yet? Get the app or extension now!

Code Block Syntax Highlighter Injector

Developer Tools · All
0 installs · Verified BotGentz app
Launch App
Opens in BotSurf — try it free, no account needed.
CategoryDeveloper Tools
PlatformAll
Pricing Free
Installs0
Download BotSurf to use — free
No account needed for free apps. Once BotSurf is open, find this app in Apps from the + menu.

About this app

WHAT IT DOES This script automatically scans pages for code blocks and injects syntax highlighting with language auto-detection. It identifies the programming language from class names, data attributes, or content patterns, then applies token-based coloring to keywords, strings, comments, numbers, operators, and functions. Each token type has a configurable color, making code easy to read and understand at a glance. The script supports JavaScript, Python, Java, C++, Ruby, Go, Rust, HTML, and CSS, with a fallback language selector for unrecognized blocks. Additional features include line numbers, a copy button, language badges, and dark/light themes. WHERE IT RUNS The script works on any page with code blocks—documentation sites, GitHub, GitLab, Stack Overflow, blog posts, tutorials, and any page with pre, code, or highlighted containers. It automatically detects code blocks and applies highlighting without requiring any external libraries or dependencies. HOW TO USE After installation, the script automatically highlights code blocks on page load. Open the panel to customize settings: toggle auto-highlight on or off, choose the default language, show or hide language badges, line numbers, and copy buttons, select dark or light theme, adjust font size, and configure colors for each token type (keywords, strings, comments, numbers, operators, functions). Click "Highlight Now" to manually trigger highlighting on the current page. Settings are saved and persist across sessions. TECHNICAL MECHANISM The script uses a language detection pipeline with token-based highlighting. First, it identifies code blocks by scanning for pre, code, and highlighted containers. Second, it detects the language by checking class names (e.g., "language-javascript"), data attributes, and content patterns using a scoring system. Third, it applies language-specific regex patterns to tokenize the code, using a priority-based replacement system: comments are processed first (to preserve their content), then strings, numbers, keywords, operators, and functions. Each replacement wraps matched text in a `` with inline CSS colors. Fourth, it builds a container with the highlighted content, preserving indentation and line structure. The script processes replacements in descending order of token length to avoid partial overlaps. For language detection, it uses a combination of class aliases and regex pattern matching on the first few lines of code. THE PANEL The settings panel is fully draggable and can be positioned anywhere on your screen. It automatically snaps to the nearest edge when released, keeping your workspace organized. The panel can be collapsed to a small bubble showing only a gear icon, and restored with a single click. Its position is remembered across page reloads using GM_setValue. The panel also responds to the Escape key, which instantly hides it until you click the bubble again. All settings are saved immediately when changed and persist across browser sessions. PLEASE NOTE This script requires the free BotGentz extension to run. Syntax highlighting uses a lightweight token-based parser and does not support all language-specific edge cases or complex grammar. The script does not access, store, or transmit any personal data or browsing history. All processing happens locally in your browser and never leaves your device.

Similar Apps

Log in to BotGentz

Suggest an App

Tell us what you'd find useful — if we build it, we'll email you the moment it's ready.