Text Converter

A userscript that converts text in the browser.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

You will need to install an extension such as Tampermonkey to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

लेखक
xhofe
दैनिक इंस्टॉल
0
एकूण इंस्टॉल
2
रेटिंग
0 0 0
आवृत्ती
0.0.0
बनवली
2026-04-07
अपडेट केली
2026-04-07
आकार
8.07 KB
License
MIT
यांवर लागू होते:
सर्व संकेतस्थळे

Text Converter

A Tampermonkey userscript for in-page text conversion. Select text on any webpage, click the floating trigger button, and choose a converter to replace the selected text in place.

Features

  • Works on all websites (*://*/*)
  • Floating T button appears near the selection
  • Keyboard shortcut: Cmd+Option+C (Mac) / Ctrl+Alt+C (Windows/Linux)
  • Preserves DOM structure when selection spans multiple elements
  • Handles <input> / <textarea> fields
  • Press Escape or click outside to dismiss

Built-in Converters

Converter Description
Unicode Decode \u4f60\u597d你好

Development

# Install dependencies
pnpm install

# Dev mode (auto-reload in Tampermonkey)
pnpm dev

# Production build
pnpm build

The compiled userscript is output to dist/monkey-text-converter.user.js.

Adding a New Converter

  1. Create a file in src/converters/:
// src/converters/my-converter.ts
import type { TextConverter } from '../types';

export const myConverter: TextConverter = {
  name: 'My Converter',
  convert(text: string): string {
    return text; // your logic here
  },
};
  1. Register it in src/main.ts:
import { myConverter } from './converters/my-converter';
registerConverter(myConverter);

Project Structure

src/
  main.ts                 # Entry point — register converters & init
  types.ts                # TextConverter interface
  converter-registry.ts   # Converter registry (register / getAll)
  text-replacer.ts        # Selection reading & DOM text replacement
  converters/
    unicode-decode.ts     # Unicode decode (\uXXXX → char)
  context-menu/
    index.ts              # Floating button & menu logic
    style.css             # UI styles

Tech Stack