extensions: real PDF/DOC icons + fix translate default URL

- pdf-editor 0.1.1 → 0.1.2: manifest.icon is a data:image/svg+xml red PDF
  document badge (dock renders it as <img>). Same on toolbar-menu.icon.
  Item-level icons dropped — those go through the native OS menu that
  doesn't render data URIs.
- translate 0.1.0 → 0.1.1: default LibreTranslate mirror was
  translate.argosopentech.com, which is now a dead domain — panel just
  said "Failed" on every request. Switched default to
  translate.disroot.org (currently up), added a datalist of known
  mirrors, and a one-shot migration off the dead default so existing
  installs recover on next load.
- docx-editor 0.1.0 → 0.1.1: manifest.icon is a data:image/svg+xml blue
  DOC document badge, index.js no longer overrides it with 📝, and the
  panel header uses the same inline SVG. Same rationale as pdf-editor —
  every extension was rendering as either 📄 or 📝, so PDF and Word
  were visually identical to the Notepad.
This commit is contained in:
Local Dev 2026-09-21 02:41:16 +02:00
parent b791871390
commit 862e92543c
6 changed files with 32 additions and 18 deletions

View file

@ -1,25 +1,24 @@
{ {
"id": "pdf-editor", "id": "pdf-editor",
"name": "PDF Editor", "name": "PDF Editor",
"version": "0.1.1", "version": "0.1.2",
"description": "Open a PDF in a full tab: read it, highlight and mark it up, reorder or rotate or drop pages, fill in its form fields, then save a new copy. Annotations are written into the saved file as real PDF content. The original is never touched.", "description": "Open a PDF in a full tab: read it, highlight and mark it up, reorder or rotate or drop pages, fill in its form fields, then save a new copy. Annotations are written into the saved file as real PDF content. The original is never touched.",
"author": "Silent Mode", "author": "Silent Mode",
"icon": "📄", "icon": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTYgMmg4bDYgNnYxMmEyIDIgMCAwIDEtMiAySDZhMiAyIDAgMCAxLTItMlY0YTIgMiAwIDAgMSAyLTJ6IiBmaWxsPSIjZGMyNjI2Ii8+PHBhdGggZD0iTTE0IDJ2Nmg2eiIgZmlsbD0iIzk5MWIxYiIvPjx0ZXh0IHg9IjEyIiB5PSIxNyIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZm9udC1mYW1pbHk9InN5c3RlbS11aSwtYXBwbGUtc3lzdGVtLHNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iNS41IiBmb250LXdlaWdodD0iODAwIiBmaWxsPSIjZmZmIj5QREY8L3RleHQ+PC9zdmc+",
"main": "index.js", "main": "index.js",
"capabilities": ["toolbar-menu", "open-tab", "context-menu-item"], "capabilities": ["toolbar-menu", "open-tab", "context-menu-item"],
"toolbar-menu": { "toolbar-menu": {
"title": "PDF Editor", "title": "PDF Editor",
"icon": "📄", "icon": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTYgMmg4bDYgNnYxMmEyIDIgMCAwIDEtMiAySDZhMiAyIDAgMCAxLTItMlY0YTIgMiAwIDAgMSAyLTJ6IiBmaWxsPSIjZGMyNjI2Ii8+PHBhdGggZD0iTTE0IDJ2Nmg2eiIgZmlsbD0iIzk5MWIxYiIvPjx0ZXh0IHg9IjEyIiB5PSIxNyIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZm9udC1mYW1pbHk9InN5c3RlbS11aSwtYXBwbGUtc3lzdGVtLHNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iNS41IiBmb250LXdlaWdodD0iODAwIiBmaWxsPSIjZmZmIj5QREY8L3RleHQ+PC9zdmc+",
"items": [ "items": [
{ "id": "open", "label": "Open a PDF…", "icon": "📄" } { "id": "open", "label": "Open a PDF…" }
] ]
}, },
"context-menu-items": [ "context-menu-items": [
{ {
"id": "open-link", "id": "open-link",
"label": "Open PDF in editor", "label": "Open PDF in editor",
"when": "linkURL", "when": "linkURL"
"icon": "📄"
} }
], ],
"updateURL": "https://navigate.st/bns/theseus.x/extensions/pdf-editor/updates.json" "updateURL": "https://navigate.st/bns/theseus.x/extensions/pdf-editor/updates.json"

View file

@ -1,7 +1,7 @@
{ {
"id": "translate", "id": "translate",
"name": "Translate", "name": "Translate",
"version": "0.1.0", "version": "0.1.1",
"description": "Right-click a selection to translate it. Sidebar panel with LibreTranslate or Google as the backend.", "description": "Right-click a selection to translate it. Sidebar panel with LibreTranslate or Google as the backend.",
"author": "Silent Mode", "author": "Silent Mode",
"icon": "🌐", "icon": "🌐",

View file

@ -115,17 +115,23 @@
</label> </label>
<label id="ltUrlLabel"> <label id="ltUrlLabel">
LibreTranslate server URL LibreTranslate server URL
<input id="ltUrl" type="url" placeholder="https://translate.argosopentech.com" /> <input id="ltUrl" type="url" placeholder="https://translate.disroot.org" list="ltMirrors" />
<datalist id="ltMirrors">
<option value="https://translate.disroot.org"></option>
<option value="https://translate.plausibility.cloud"></option>
<option value="https://lingva.ml"></option>
</datalist>
</label> </label>
<label id="ltKeyLabel"> <label id="ltKeyLabel">
LibreTranslate API key (optional) LibreTranslate API key (optional)
<input id="ltKey" type="text" placeholder="only if your instance requires one" /> <input id="ltKey" type="text" placeholder="only if your instance requires one" />
</label> </label>
<div class="hint"> <div class="hint">
LibreTranslate is a free MIT-licensed engine. Public instances rate-limit; if you LibreTranslate is a free MIT-licensed engine. Public instances rate-limit — if you
hit "too many requests", pick another URL or self-host. Google (unofficial) uses hit "too many requests" or a mirror is down, pick another URL from the list or
<code>translate.googleapis.com/translate_a/single</code> — free, no key, but self-host. Google (unofficial) uses
unofficial and Google can break it at any time. <code>translate.googleapis.com/translate_a/single</code> — no key, but unofficial
and Google can break it at any time.
</div> </div>
</div> </div>
@ -164,7 +170,12 @@
const defaultTarget = LANGS.some(([c]) => c === browserLang) && browserLang !== "en" ? browserLang : "en"; const defaultTarget = LANGS.some(([c]) => c === browserLang) && browserLang !== "en" ? browserLang : "en";
const S = window.silentmode?.storage; const S = window.silentmode?.storage;
const settingsState = { backend: "libretranslate", ltUrl: "https://translate.argosopentech.com", ltKey: "" }; const DEFAULT_LT_URL = "https://translate.disroot.org";
// Old defaults that we now migrate off — argosopentech.com went offline.
// If a user's saved URL matches one of these, silently upgrade it to the
// current working default so the panel isn't broken out of the box.
const DEAD_LT_URLS = new Set(["https://translate.argosopentech.com"]);
const settingsState = { backend: "libretranslate", ltUrl: DEFAULT_LT_URL, ltKey: "" };
const uiState = { src: "auto", tgt: defaultTarget }; const uiState = { src: "auto", tgt: defaultTarget };
async function loadState() { async function loadState() {
@ -175,6 +186,11 @@
const ui = await S.get("ui", null); const ui = await S.get("ui", null);
if (ui && typeof ui === "object") Object.assign(uiState, ui); if (ui && typeof ui === "object") Object.assign(uiState, ui);
} catch (e) { console.warn("load state failed:", e); } } catch (e) { console.warn("load state failed:", e); }
// One-shot migration off a dead default URL.
if (DEAD_LT_URLS.has(settingsState.ltUrl)) {
settingsState.ltUrl = DEFAULT_LT_URL;
if (S) try { await S.set("settings", settingsState); } catch {}
}
backendSel.value = settingsState.backend; backendSel.value = settingsState.backend;
ltUrl.value = settingsState.ltUrl; ltUrl.value = settingsState.ltUrl;
ltKey.value = settingsState.ltKey; ltKey.value = settingsState.ltKey;
@ -184,7 +200,7 @@
} }
async function saveSettings() { async function saveSettings() {
settingsState.backend = backendSel.value; settingsState.backend = backendSel.value;
settingsState.ltUrl = ltUrl.value.trim().replace(/\/+$/, "") || "https://translate.argosopentech.com"; settingsState.ltUrl = ltUrl.value.trim().replace(/\/+$/, "") || DEFAULT_LT_URL;
settingsState.ltKey = ltKey.value.trim(); settingsState.ltKey = ltKey.value.trim();
if (S) try { await S.set("settings", settingsState); } catch {} if (S) try { await S.set("settings", settingsState); } catch {}
} }

View file

@ -1,10 +1,10 @@
{ {
"id": "docx-editor", "id": "docx-editor",
"name": "Word editor", "name": "Word editor",
"version": "0.1.0", "version": "0.1.1",
"description": "Open, edit and save Word documents (.docx) in a full Theseus tab. Ribbon-style formatting, tables, lists, images and links; headers, footers, footnotes, page setup and the document's own styles are carried through a save untouched.", "description": "Open, edit and save Word documents (.docx) in a full Theseus tab. Ribbon-style formatting, tables, lists, images and links; headers, footers, footnotes, page setup and the document's own styles are carried through a save untouched.",
"author": "Silent Mode", "author": "Silent Mode",
"icon": "📝", "icon": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTYgMmg4bDYgNnYxMmEyIDIgMCAwIDEtMiAySDZhMiAyIDAgMCAxLTItMlY0YTIgMiAwIDAgMSAyLTJ6IiBmaWxsPSIjMjU2M2ViIi8+PHBhdGggZD0iTTE0IDJ2Nmg2eiIgZmlsbD0iIzFlNDBhZiIvPjx0ZXh0IHg9IjEyIiB5PSIxNyIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZm9udC1mYW1pbHk9InN5c3RlbS11aSwtYXBwbGUtc3lzdGVtLHNhbnMtc2VyaWYiIGZvbnQtc2l6ZT0iNS41IiBmb250LXdlaWdodD0iODAwIiBmaWxsPSIjZmZmIj5ET0M8L3RleHQ+PC9zdmc+",
"main": "index.js", "main": "index.js",
"capabilities": ["sidebar-panel", "open-tab"], "capabilities": ["sidebar-panel", "open-tab"],
"updateURL": "https://navigate.st/bns/theseus.x/extensions/community/docx-editor/updates.json" "updateURL": "https://navigate.st/bns/theseus.x/extensions/community/docx-editor/updates.json"

View file

@ -25,7 +25,6 @@ module.exports = {
api.registerSidebarPanel({ api.registerSidebarPanel({
id: "main", id: "main",
title: "Word editor", title: "Word editor",
icon: "📝",
page: "panel.html", page: "panel.html",
}); });

View file

@ -59,7 +59,7 @@ h2 { font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
</head> </head>
<body> <body>
<div class="head"><span class="ico">📝</span><h1>Word editor</h1></div> <div class="head"><span class="ico" aria-hidden="true"><svg width="20" height="20" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z" fill="#2563eb"/><path d="M14 2v6h6z" fill="#1e40af"/><text x="12" y="17" text-anchor="middle" font-family="system-ui,-apple-system,sans-serif" font-size="5.5" font-weight="800" fill="#fff">DOC</text></svg></span><h1>Word editor</h1></div>
<div class="body"> <div class="body">
<p class="lede">Open a .docx in a full tab. Headers, footers, footnotes, page setup and <p class="lede">Open a .docx in a full tab. Headers, footers, footnotes, page setup and