How I built a 13-language browser extension with no backend (Manifest V3, RTL, Gumroad licence keys)
Disclosure: I built PromptShelf, the extension this article is about. The free version is fully usable, and there is a paid Pro tier. Links are at the end. I kept retyping the same AI prompts: "rewrite this clearer", "r
Disclosure: I built PromptShelf, the extension this article is about. The free version is fully usable, and there is a paid Pro tier. Links are at the end.
I kept retyping the same AI prompts: "rewrite this clearer", "review this code", "draft an email toβ¦". So I built a small side-panel extension to store them. I set myself three rules:
- No backend. Everything stays on the user's device.
- One-time price. No subscription and no account.
- 13 languages from day one, including right-to-left Arabic.
These are the parts that were less obvious than I expected.
1. One codebase, two sidebars
Chrome and Edge have the sidePanel API. Firefox has sidebar_action. I keep two manifests and one background script that detects which API exists:
// background.js
if (chrome.sidePanel && chrome.sidePanel.setPanelBehavior) {
chrome.runtime.onInstalled.addListener(() => {
chrome.sidePanel.setPanelBehavior({ openPanelOnActionClick: true }).catch(() => {});
});
} else if (typeof browser !== "undefined" && browser.sidebarAction) {
chrome.action.onClicked.addListener(() => browser.sidebarAction.toggle());
}
Firefox's validator still warns that sidePanel.open "is not supported". That is expected, because the call sits behind a feature check and never runs there.
2. Ask for host permissions only when needed
Inserting a prompt into a chat page means touching that page. Instead of requesting every chat site at install time, the sites are optional_host_permissions. The browser asks the first time you press Insert on a site. The list of sites lives in one config file, and the build script fails if the manifest and the config ever disagree.
Inserting into chat pages is the fragile part, because their page structure changes often. That is why Copy is always offered as a fallback.
3. {{variables}} and multi-step chains
A prompt like Write a {{tone}} email to {{recipient}} about {{topic}} becomes a small form. The parser is a single regex:
extractVars(text) {
const re = /\{\{\s*([^{}]+?)\s*\}\}/g;
const out = []; let m;
while ((m = re.exec(text)) !== null) if (!out.includes(m[1])) out.push(m[1]);
return out;
}
Chains are prompts split by a line containing only ---. You fill the variables once, then step through: insert step 1, read the answer, then step 2.
4. i18n for 13 languages, kept honest by a script
The interface uses the standard _locales/<lang>/messages.json. With 13 languages, drift is guaranteed, so the build checks that every locale has the same set of keys and the same $1 placeholders. A missing key fails the build.
For Arabic, the panel sets dir from @@bidi_dir, and the CSS uses logical properties, so the layout mirrors without a separate stylesheet. I verified the right-to-left rendering by loading the extension in headless Edge with --lang=ar and checking the DOM.
The bundled prompts (1,300 in total, 100 per language) are written for each market, not translated word for word. For example, the Russian prompts use Telegram and VK examples, the Chinese ones use WeChat, and the Japanese ones use a formal business tone. I also check prompt IDs and variable names across all 13 languages with a script.
5. Licence keys without a server
Pro is unlocked by a Gumroad licence key. The extension calls Gumroad's public verify endpoint directly:
const body = new URLSearchParams();
body.set("product_id", GUMROAD_PRODUCT_ID);
body.set("license_key", key);
body.set("increment_uses_count", countUse ? "true" : "false");
const res = await fetch("https://api.gumroad.com/v2/licenses/verify", { method: "POST", body });
The result is cached and re-checked about every 14 days, with a 30-day offline grace. Refunded or charged-back purchases are rejected at the next check. The endpoint returns access-control-allow-origin: *, so no proxy is needed.
The honest trade-off: a check that runs on the user's machine can be bypassed by someone determined. For a $9 tool, I would rather have zero servers and zero user tracking than build DRM.
6. Testing what I actually could
| What | How | Result |
|---|---|---|
| Manifests, 13 locales, prompt packs | PowerShell build script | 0 failures |
| Extension loads | Headless Edge with --load-extension, en/ar/ru |
0 extension errors |
| RTL |
--lang=ar, check dir="rtl"
|
passes |
| Licence | Real key from a test purchase against the live API | valid key accepted, fake key rejected |
| Insert into every chat site | β | not verified for every site yet |
That last row is why the listing says "supported sites, copy always works" rather than promising one-click insertion everywhere.
Try it / feedback
- Website (13 languages): https://raiden-171.github.io/promptshelf/
- Pro (one-time): https://hamedgx.gumroad.com/l/vuusgq
- The Firefox listing is in review; the Edge listing is coming.
I would really like feedback on the insertion approach, and corrections to any of the 12 machine-assisted translations. If your language reads awkwardly, tell me which string and I'll fix it.
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.