From 0c08a833773815d9bc91ec7824030de025b679e1 Mon Sep 17 00:00:00 2001 From: Utku Bilen Demir <84389167+UtkuBilenDemir@users.noreply.github.com> Date: Wed, 23 Sep 2026 14:27:59 +0200 Subject: [PATCH] Kanzi 0.6.14: fix anonymised sharing NS_ERROR (anonId missing) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - plugin/manager.html: shareAnonymized fetch now robust to missing prefs (getBoolPref/getCharPref NS_ERROR) — defaults to share=true, anonId=anon with auto-generation, British spelling - Fixes 'no annotations added' when anonId pref missing (thrown 0x8000ffff, caught silently, no POST) - Bump to 0.6.14 --- README.md | 2 +- plugin/manager.html | 17 ++++++++++++++--- plugin/manifest.json | 2 +- updates.json | 9 +++++++++ 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9dfff97..7cb739b 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Import Kindle `My Clippings.txt` highlights into Zotero as native annotations, d # Install -1. Download `kindle-zotero-importer.xpi` from [Releases](../../releases) (latest `0.6.13`, or `0.6.12-beta` for preview). +1. Download `kindle-zotero-importer.xpi` from [Releases](../../releases) (latest `0.6.14`, or `0.6.13-beta` for preview). 2. In Zotero: `Tools` → `Plugins` → `gear` → `Install Plugin From File…` → pick the `.xpi` → restart Zotero. 3. `Tools` → `Kanzi…` to open the manager. diff --git a/plugin/manager.html b/plugin/manager.html index be807a0..f1e5f55 100644 --- a/plugin/manager.html +++ b/plugin/manager.html @@ -237,9 +237,20 @@ const bar = document.getElementById('reimport-bar'); if (bar) bar.style.display = 'none'; this.status(`${summary.counts.final_annotations || 0} positioned annotations processed; ${this.rows.length} review rows remain.`, results.failed.length > 0); - // Anonymized sharing if opted in + // Anonymised sharing if opted in — robust to missing prefs (British spelling) try { - if (Services.prefs.getBoolPref("extensions.kindleZoteroImporter.shareAnonymized")) { + let share = true; + try { share = Services.prefs.getBoolPref("extensions.kindleZoteroImporter.shareAnonymized"); } catch(e) { share = true; } + if (share) { + let anonId = "anon"; + try { anonId = Services.prefs.getCharPref("extensions.kindleZoteroImporter.anonId") || "anon"; } catch(e) { anonId = "anon"; } + // ensure anonId exists for next time + if (anonId === "anon") { + try { + anonId = Math.random().toString(36).slice(2,10) + Date.now().toString(36); + Services.prefs.setCharPref("extensions.kindleZoteroImporter.anonId", anonId); + } catch(e) {} + } const anonData = (data.finalPlan?.annotations || []).map(a => ({ citation_key: a.citation_key, clipping_id_hash: a.clipping_id ? a.clipping_id.slice(0,8) : null, @@ -254,7 +265,7 @@ fetch("https://annotation.utkubilen.de/highlights", { method: "POST", headers: {"Content-Type":"application/json"}, - body: JSON.stringify({anonId: Services.prefs.getCharPref("extensions.kindleZoteroImporter.anonId") || "anon", data: anonData}) + body: JSON.stringify({anonId, data: anonData}) }).catch(()=>{}); } } catch(e) {} diff --git a/plugin/manifest.json b/plugin/manifest.json index b12d2d6..4ce68c6 100644 --- a/plugin/manifest.json +++ b/plugin/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "Kanzi", - "version": "0.6.13", + "version": "0.6.14", "description": "Kindle annotations to Zotero — My Clippings.txt → native annotations.", "homepage_url": "https://github.com/UtkuBilenDemir/kindle-zotero_importer", "author": "Utku Bilen Demir", diff --git a/updates.json b/updates.json index 09749d1..044e9ea 100644 --- a/updates.json +++ b/updates.json @@ -2,6 +2,15 @@ "addons": { "kindlezoteroimporter@utkubilen.de": { "updates": [ + { + "version": "0.6.14", + "update_link": "https://github.com/UtkuBilenDemir/kindle-zotero_importer/releases/download/v0.6.14/kindle-zotero-importer.xpi", + "applications": { + "zotero": { + "strict_min_version": "6.999" + } + } + }, { "version": "0.6.13", "update_link": "https://github.com/UtkuBilenDemir/kindle-zotero_importer/releases/download/v0.6.13/kindle-zotero-importer.xpi",