From 000599bfff77c7cb4f5acccd4f62d63255e3348d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adomas=20Ven=C4=8Dkauskas?= Date: Mon, 21 Feb 2022 13:48:54 +0200 Subject: [PATCH] Do not load citeproc-rs on Style.init() unless it's enabled Closes #2363 --- chrome/content/zotero/xpcom/prefs.js | 3 +++ chrome/content/zotero/xpcom/style.js | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/prefs.js b/chrome/content/zotero/xpcom/prefs.js index 18175f33f1..f21ea54a08 100644 --- a/chrome/content/zotero/xpcom/prefs.js +++ b/chrome/content/zotero/xpcom/prefs.js @@ -270,6 +270,9 @@ Zotero.Prefs = new function(){ if (!win.Zotero) continue; Zotero.updateQuickSearchBox(win.document); } + }], + [ "cite.useCiteprocRs", function(val) { + val && Zotero.CiteprocRs.init(); }] ]; diff --git a/chrome/content/zotero/xpcom/style.js b/chrome/content/zotero/xpcom/style.js index d037614090..9f9281cb8d 100644 --- a/chrome/content/zotero/xpcom/style.js +++ b/chrome/content/zotero/xpcom/style.js @@ -45,7 +45,9 @@ Zotero.Styles = new function() { * Initializes styles cache, loading metadata for styles into memory */ this.init = Zotero.Promise.coroutine(function* (options = {}) { - yield Zotero.CiteprocRs.init(); + if (Zotero.Prefs.get('cite.useCiteprocRs')) { + yield Zotero.CiteprocRs.init(); + } // Wait until bundled files have been updated, except when this is called by the schema update // code itself