Text Converter

A userscript that converts text in the browser.

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
作者
xhofe
1日のインストール数
0
累計インストール数
2
評価
0 0 0
バージョン
0.0.0
作成日
2026/04/07
更新日
2026/04/07
大きさ
8.07KB
ライセンス
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