mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-09-22 17:16:19 -07:00
feat(dictionary): add Hachidori backend support
- Add backend selection, setup gating, Anki integration, and external host support - Add launcher flags, documentation, packaging, and focused tests - Open on-demand overlay modals on the first attempt
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
import { createAnkiGateway } from "./anki.js";
|
||||
import { fetchAnkiIndex } from "./anki-index.js";
|
||||
|
||||
self.onmessage = async ({ data: source }) => {
|
||||
try {
|
||||
const gateway = createAnkiGateway();
|
||||
const invoke = (action, params, timeoutMs) =>
|
||||
gateway.invoke(action, params, source.apiKey, timeoutMs, source.url);
|
||||
self.postMessage({ rows: await fetchAnkiIndex(invoke, source) });
|
||||
} catch (error) {
|
||||
self.postMessage({ error: error.message || String(error) });
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user