A Chrome/Firefox extension for looking up StarDict dictionary definitions by selecting words on web pages. Also includes Web dictionarys and AI lookups.
** known bugs:
- wrong error message of failing to delet a dict
- importing yomitan dict works but the entry is still a json
- rich text formating not preserved on import
Change manifest.json line 11-13 from:
to:
"background": {
"service_worker": "background.js"
}Keep the manifest as-is with:
"background": {
"scripts": ["background.js", "structured-db.js"]
}- Select any word on web pages to see a lookup icon
- Click the icon to display dictionary definition in a popup
- Upload and manage multiple StarDict dictionaries
- NEW: Import Yomitan dictionary archives (.zip files) with full rich formatting support
- Supports compressed dictionary files (.dict.gz, .dict.dz)
- HTML-formatted definitions with rich structured content
- Cross-browser compatible
- Multiple query groups with different display methods
- Web dictionary APIs and AI integration
- Touch and mouse gesture support
- Smart Suggestions: "Did you mean" suggestions for compound word decomposition
- Internal Word Analysis: Automatically finds constituent words within compound words (e.g., "apfelbaum" → "apfel", "baum")
- Traditional .ifo/.idx/.dict file format
- Supports compressed dictionaries (.gz, .dz)
- Widely available dictionary format
- Modern ZIP archive format with JSON data files
- Supports structured content (rich formatting, images)
- Advanced features like kanji data, tags, and metadata
- Clean Room Implementation: This extension implements Yomitan dictionary support using a clean room approach, analyzing the published format specifications without copying any Yomitan source code. This ensures license compatibility while maintaining full format support.
LangBro now supports importing Yomitan dictionary archives with full preservation of rich formatting and structured content.
- Etymology sections with collapsible
<details>/<summary>tags - Definition lists with proper
<ol>/<li>formatting - Links to external resources (Wiktionary, etc.)
- Images and media content
- HTML formatting preservation
- Combines multiple term entries for the same word
- Preserves all definition variations
- Maintains proper grouping and sequencing
- Dictionary tags and categories
- Frequency data and scoring
- Kanji information and readings
- Source language/target language metadata
- Access Settings: Go to extension options → "Offline Dictionary" tab
- Upload Archive: Click "Upload Yomitan Dictionary" and select a
.zipfile - Automatic Processing:
- Extracts ZIP archive contents
- Parses JSON data files (
term_bank_*.json,kanji_bank_*.json, etc.) - Converts structured content to HTML
- Groups multiple definitions per term
- Stores in IndexedDB with full metadata
- Progress Tracking: Real-time progress display during import
- Ready to Use: Dictionary appears in query groups immediately
Yomitan dictionaries contain multiple JSON files:
index.json- Dictionary metadata and configurationterm_bank_*.json- Term definitions and readingskanji_bank_*.json- Kanji data and informationtag_bank_*.json- Tag definitions and categoriesterm_meta_bank_*.json/kanji_meta_bank_*.json- Additional metadata
Etymology Sections:
<details class="gloss-sc-details" data-sc-content="details-entry-Etymology">
<summary class="gloss-sc-summary">Etymology</summary>
<div>Del inglés medio wanten...</div>
</details>Definition Lists:
<ol class="gloss-sc-ol" data-sc-content="glosses">
<li class="gloss-sc-li">Querer, desear.</li>
<li class="gloss-sc-li">Faltar.</li>
</ol>Links:
<a href="https://es.wiktionary.org/wiki/want#English" target="_blank" rel="noreferrer noopener">
<span>Wiktionary</span>
<span>🔗</span>
</a>- License Compliant: Uses MIT-licensed JSZip instead of Yomitan's zip.js
- Format Versions: Supports Yomitan v1, v2, and v3 dictionary formats
- Cross-Platform: Works identically on Chrome, Firefox, and other browsers
- Performance: Efficient batch processing with progress feedback
- Data Integrity: Preserves all original formatting and metadata
LangBro includes intelligent suggestion features to help users discover related words and compound word components.
When you select text that includes additional characters after a word, LangBro suggests alternative lookups based on the selected word plus following text.
Example:
- Select "apple" with " pie" following it
- LangBro suggests looking up "applepie" or "application" if those terms exist in your dictionaries
For compound words, LangBro automatically decomposes them into constituent parts that exist in your dictionaries.
Example:
- Search for "apfelbaum" (German compound word)
- LangBro finds and suggests: "apfel" (apple) and "baum" (tree)
- All suggestions are clickable for immediate lookup
Features:
- Finds all substrings of the search term that exist as dictionary entries
- Displays constituent words in clickable badges
- Includes the original search term when suggestions are available
- Works with any dictionary format (StarDict, Yomitan)
- Configurable per query group in extension settings
Use Cases:
- Language learning: Break down compound words in German, Dutch, etc.
- Technical terms: Decompose complex terminology
- Historical linguistics: Find word roots and components
- Clone or download the extension files
- Modify
manifest.jsonfor your browser (see above) - Load as unpacked extension in your browser's developer mode
- Go to extension options to upload dictionary files
The project includes automated build scripts for creating browser-specific extension packages:
npm run build:chrome-extThis command:
- Builds the RxJS components (
npm run build:rxjs) - Creates a Chrome-compatible manifest and packages the extension
- Generates a
.crxfile in thechrome-ext/directory - Builds development assets for debugging
npm run build:ff-extThis command:
- Builds the RxJS components (
npm run build:rxjs) - Packages the extension with Firefox-compatible manifest
- Generates a
.zipfile in theff-ext/directory - Builds development assets for debugging
npm run build:devBuilds the extension in development mode with source maps for debugging.
npm run watchContinuously watches for file changes and rebuilds automatically during development.
- Ensure
manifest.jsonuses"service_worker": "background.js" - Select all extension files (excluding development files like README.md)
- Create a ZIP archive of the selected files
- For Chrome Web Store: Upload the ZIP to the Developer Dashboard
- For manual installation: Rename .zip to .crx (optional)
- Ensure
manifest.jsonuses"scripts": ["background.js"] - Select all extension files
- Create a ZIP archive
- Rename the .zip file to .xpi
- For Development: Use "Load Temporary Add-on" in Firefox debugging
- For Distribution: Submit to AMO (addons.mozilla.org) for signing and verification
- Manual Installation: Unsigned .xpi files cannot be installed permanently due to Firefox security policies
The build scripts automatically exclude files listed in .gitignore and include:
- manifest.json (modified for target browser)
- background.js
- content-rxjs.js
- popup.html
- popup.js
- options.html
- options.js
- pako.min.js
- jszip.min.js
- icon128.png
- settings-store.js
- structured-db.js
- yomitan-importer.js
This section provides the required information for submitting source code to Mozilla Add-ons (AMO) for review.
- OS: Linux (primary), macOS, or Windows
- Node.js: Version 18 or higher (LTS recommended)
- npm: Version 8 or higher (included with Node.js)
- Download and install Node.js from https://nodejs.org/ (choose LTS version)
- npm is automatically included with Node.js installation
- Verify installation:
node --versionandnpm --version
To create an exact copy of the extension from source:
- Clone/Download Source: Obtain all source files from the repository
- Install Dependencies: Run
npm installin the project root directory - Build RxJS Components: Run
npm run build:rxjsto generate bundled JavaScript (this createsdist/directory with transpiled files) - Package for Firefox: Run
npm run build:ff-extto create the Firefox extension package - Output: The exact extension package will be created as
ff-ext/ff_LangBro_[version].zip
The build script npm run build:ff-ext executes all necessary technical steps:
- Builds RxJS components with Webpack
- Modifies manifest.json for Firefox compatibility
- Packages all required files into a ZIP archive
All source files are included in the repository:
- JavaScript files (.js) - not transpiled, concatenated, or minified except for third-party libraries
- HTML, CSS, JSON files
- Build configuration files (webpack.config.js, package.json)
- Documentation (README.md, README_DEV.md)
Note: The dist/ directory contains machine-generated files and is excluded from source code submission. Reviewers can regenerate them using the build instructions above.
The extension uses the following open-source third-party libraries:
- JSZip (MIT License): For ZIP file handling. Source: https://github.com/Stuk/jszip
- Pako (MIT License): For zlib compression. Source: https://github.com/nodeca/pako
- RxJS (Apache License 2.0): For reactive programming. Source: https://github.com/ReactiveX/rxjs
- opencode-ai (MIT License): For AI integration. Source: https://github.com/sst/opencode
All licenses are included in the respective library files or repositories. The extension complies with all license terms.
- Click the extension icon to check status
- Use "Dictionary Settings" to upload StarDict files or import Yomitan dictionary archives
- Configure query groups in the settings to customize lookup behavior
- Select words on web pages to see definitions with rich formatting
- Use touch gestures or mouse clicks for quick lookups