| name | sorkalam |
| description | Sorkalam MV3 Chrome extension (Tamil ↔ English). Use when editing popup.js, event.js, content.js, manifest.json, or dictionary lookup behavior in this repo.
|
Sorkalam extension (this repo)
Vanilla MV3 extension: Wiktionary + Tamil VU glossary. No frameworks in the active path.
Files
| File | Role |
|---|
popup.js | UI, Wiktionary fetch, Tamil VU via sendMessage, normalizeInput() |
glossary-cache.js | IndexedDB cache for Tamil VU HTML + parsed entries (popup + SW) |
tamilvu-glossary-parse.js | HTML table → { columns, rows } JSON via DOMParser (popup only) |
event.js | Service worker: selection relay, Tamil VU fetch + IDB HTML cache |
content.js | lastCapturedSelection, answers getSelectedWord |
manifest.json | MV3 permissions, <all_urls> content script |
Full architecture: TECH_DETAILS_V6.md.
Message actions (keep names consistent)
| Action | Sender → receiver | Response |
|---|
getSelectedWordFromPage | popup → event.js | { selectedWord } |
getSelectedWord | event.js → content script | { selectedWord } |
fetchTamilVUGlossary | popup → event.js | { ok, glossaryPageHtml, fromCache?, cacheKey } or error |
Popup: check GlossaryCache.getTamilVu for glossaryEntries first; else parse HTML and setTamilVu with table + entries. Each entry: { translationText, subjectArea } (opposite language from search). SW caches HTML on network fetch.
Rules for changes
- Async
sendResponse: use async IIFE + return true in event.js (see references/message-passing.md).
- Tamil VU: never
fetch tamilvu.org from the popup — use event.js + host_permissions (HTTPS only).
- English input: lowercase via
normalizeInput() before Tamil VU / Wiktionary.
- Selection: cache in content script; popup opens often clear live
getSelection().
- Icons: only reference PNGs that exist, or omit from manifest.
MV3 references (local)
Upstream (do not vendor into this repo)