Kanji Reading Helper is a Chrome extension that provides the hiragana readings for selected Japanese kanji or text. It uses both a local database and the Goo Labs API to fetch and display readings, making it a convenient tool for Japanese learners.
- Displays the hiragana reading of selected Japanese kanji or text.
- Uses a tooltip to display the reading directly on the webpage.
- Local database for frequently used words for faster access.
- Fallback to Goo Labs API (
https://labs.goo.ne.jp/api/hiragana
) for unknown words.
-
Clone or Download the Repository
- Clone the repository using Git:
git clone https://github.com/wespc/kanji-reading-helper.git
- Or download the repository as a ZIP file and extract it.
- Clone the repository using Git:
-
Open Chrome Extensions Page
- Navigate to
chrome://extensions
in your Chrome browser.
- Navigate to
-
Enable Developer Mode
- Toggle the Developer mode switch in the top-right corner.
-
Load the Extension
- Click on Load unpacked and select the folder containing the extension files (
content.js
,manifest.json
, andpopup.html
).
- Click on Load unpacked and select the folder containing the extension files (
We welcome contributions to improve Kanji Reading Helper! To maintain a clean and stable workflow, all development should be done on the dev
branch. Here’s the step-by-step process:
-
Fork and Clone the Repository
- Fork this repository to your GitHub account.
- Clone the forked repository locally:
git clone https://github.com/wespc/kanji_reader.git cd kanji_reader
-
Switch to the
dev
Branch- Make sure you are working on the
dev
branch:git checkout dev
- Make sure you are working on the
-
Create a New Branch for Your Work
- Create a new branch for your feature or bug fix based on
dev
. Use a meaningful name for your branch:git checkout -b feature/your-feature-name
- Create a new branch for your feature or bug fix based on
-
Make Changes
- Implement your feature or fix the bug.
- Test your changes thoroughly to ensure they work as expected.
-
Commit Your Changes
- Write clear and descriptive commit messages:
git add . git commit -m "Add a clear description of your changes"
- Write clear and descriptive commit messages:
-
Push Your Branch
- Push your branch to your forked repository:
git push origin feature/your-feature-name
- Push your branch to your forked repository:
-
Submit a Pull Request
- Open a pull request targeting the
dev
branch of the main repository. - Provide a clear description of your changes in the pull request.
- Open a pull request targeting the
- After loading the extension, it will automatically run on all webpages.
- Select any Japanese kanji or text on a webpage.
- A tooltip will appear showing the selected text and its hiragana reading.
This extension uses the Goo Labs API (https://labs.goo.ne.jp/api/hiragana
) to fetch hiragana readings for unknown words. To use the extension, you must:
-
Register for a Goo Labs API Key
- Visit Goo Labs API to register and obtain an API key.
-
Add Your API Key
- Open
content.js
and replace the placeholderyour_api_key
with your actual API key:app_id: 'your_api_key',
- Open
content.js
: The main script that handles text selection, tooltip creation, and API requests.manifest.json
: Defines the extension's permissions, scripts, and metadata.popup.html
: The popup UI for the extension, providing a simple description.
The following permissions are required by the extension:
- Active Tab: To interact with content on the active webpage.
- Host Permissions: To access
https://labs.goo.ne.jp/api/hiragana
.
-
Tooltip Doesn't Appear:
- Ensure the extension is properly loaded in
chrome://extensions
. - Check the console for errors (
Ctrl+Shift+J
).
- Ensure the extension is properly loaded in
-
Error Fetching Readings:
- Verify that the API key in
content.js
is correct. - Ensure you have an active internet connection.
- Verify that the API key in
-
Extension Not Working on Some Pages:
- The extension may not work on restricted pages like
chrome://
orfile://
.
- The extension may not work on restricted pages like
- Add katakana reading support.
- Enable custom styling for the tooltip.
- Expand the local word database.
This project is licensed under the MIT License.
Created by [PENG CHENG/wespc].