A Chrome extension that automatically replaces typed patterns with predefined text shortcuts.
- Exact Pattern Matching: Replace specific text patterns with longer text
- Configurable Delay: Set a delay (default 300ms) before replacement to avoid premature triggers
- Persistent Storage: Shortcuts sync across devices via Chrome sync
- Export/Import: Backup and restore shortcuts as JSON files
- Works Everywhere: Functions on all websites in text inputs, textareas, and contenteditable elements
- Clone or download this repository
- Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode" (toggle in top right)
- Click "Load unpacked"
- Select the
keyshortfolder
- Click the extension icon or right-click and select "Options"
- In the settings page, enter:
- Pattern: The text to detect (e.g.,
test-) - Replacement: The text to replace it with (e.g.,
Keyshort Test)
- Pattern: The text to detect (e.g.,
- Click "Add Shortcut"
Simply type your pattern in any text field. After the configured delay (default 300ms), it will automatically be replaced with your predefined text.
Example:
- Type:
test- - Wait 300ms
- Result:
Keyshort Test
- Open the extension options page
- Change the "Replacement delay (ms)" value
- Click "Save Delay"
Export:
- Click "π₯ Export" button to download your shortcuts as a JSON file
Import:
- Click "π€ Import" button and select a previously exported JSON file
- The extension monitors all text input fields on web pages
- When you type, it starts a timer based on your configured delay
- After the delay expires (no more typing), it checks if the text ends with any of your patterns
- If an exact match is found, it replaces the pattern with your replacement text
- The cursor position is preserved after replacement
- Manifest Version: V3
- Permissions:
storage,activeTab - Storage: Chrome sync storage (automatically backed up and synced)
- Scope: All URLs (
<all_urls>)
keyshort/
βββ manifest.json # Extension configuration
βββ content.js # Pattern detection and replacement logic
βββ storage.js # Chrome storage helper functions
βββ options.html # Settings page UI
βββ options.js # Settings page logic
βββ options.css # Settings page styling
βββ README.md # This file
The extension comes with one default shortcut:
test-βKeyshort Test
You can modify or delete this in the options page.
- All data is stored locally in Chrome's sync storage
- No data is sent to external servers
- The extension only monitors text input to detect patterns
- Export files are saved locally on your device
Shortcuts not working?
- Check that the extension is enabled in
chrome://extensions/ - Verify your pattern is correct in the options page
- Make sure you're waiting for the full delay period
- Check that the pattern matches exactly (not part of a larger word)
Import failed?
- Ensure the JSON file is properly formatted
- Check that the file contains valid shortcuts and delay values
MIT License - Feel free to modify and distribute as needed.