diff --git a/chrome/content/zotero/bibliography.js b/chrome/content/zotero/bibliography.js index 6d278fdf5d..3a992b76f8 100644 --- a/chrome/content/zotero/bibliography.js +++ b/chrome/content/zotero/bibliography.js @@ -324,6 +324,7 @@ var Zotero_File_Interface_Bibliography = new function() { this.manageStyles = function () { + _io.dontActivateDocument = true; document.querySelector('dialog').cancelDialog(); var win = Zotero.Utilities.Internal.openPreferences('zotero-prefpane-cite', { scrollTo: '#styles' diff --git a/chrome/content/zotero/xpcom/integration.js b/chrome/content/zotero/xpcom/integration.js index 13ca9f6a73..b9af1d80e2 100644 --- a/chrome/content/zotero/xpcom/integration.js +++ b/chrome/content/zotero/xpcom/integration.js @@ -329,7 +329,9 @@ Zotero.Integration = new function() { if (document) { try { await document.cleanup(); - await document.activate(); + if (!Zotero.Integration.currentSession._dontActivateDocument) { + await document.activate(); + } // Call complete function if one exists if (document.complete) { @@ -956,6 +958,7 @@ Zotero.Integration.Session = function(doc, app) { this.primaryFieldType = app.primaryFieldType; this.secondaryFieldType = app.secondaryFieldType; this.outputFormat = app.outputFormat || 'rtf'; + this._dontActivateDocument = false; this._sessionUpToDate = false; this._app = app; @@ -1889,6 +1892,7 @@ Zotero.Integration.Session.prototype.setDocPrefs = async function (showImportExp } if (!io.style || !io.fieldType) { + this._dontActivateDocument = io.dontActivateDocument; throw new Zotero.Exception.UserCancelled("document preferences window"); }