Skip to content

v0.1.5

Choose a tag to compare

@cannolis cannolis released this 09 May 15:00
· 4 commits to main since this release

ZotRead v0.1.5 — fix prefs pane unreachable after v0.1.4

What was wrong

v0.1.3 fixed blank labels by switching from <groupbox onload> to a top-of-document <script>. v0.1.4 then added await document.readyState === "complete" to fix scope dropdown emptiness from the script-runs-during-parse race. Neither pattern is robust on Zotero 9 prefs panes — the latter ended up deadlocking because the prefs sub-frame's readyState may never transition to "complete", leaving the prefs pane completely unreachable.

Fix

Switched to the pattern used by windingwind/zotero-pdf-translate (proven on Zotero 7 and 9): root the prefs pane in a <vbox id="..." onload="...">. onload fires reliably on <vbox> (unlike <groupbox>) after the DOM is fully parsed, so DOM lookups in registerPrefsScripts find every widget on the first try, and FTL labels render before the script runs.

-<script>
-  Zotero.__addonInstance__.hooks.onPrefsEvent("load", { window });
-</script>
-<groupbox>
+<vbox
+  id="zotero-prefpane-__addonRef__-root"
+  onload="Zotero.__addonInstance__.hooks.onPrefsEvent('load', { window })"
+>
+<groupbox>
   ...
 </groupbox>
+</vbox>

The DOM-ready wait in registerPrefsScripts is no longer needed and is removed.

Install

Same as before — download zot-read.xpi and re-install via Tools → Add-ons → gear icon → Install Add-on From File….