diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index 2abf5878ac..0d165a525f 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -66,6 +66,18 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js"); this.getMainWindow = function () { return Services.wm.getMostRecentWindow("navigator:browser"); }; + + /** + * @return {ChromeWindow[]} - An array of open windows + */ + this.getMainWindows = function () { + var enumerator = Services.wm.getEnumerator("navigator:browser"); + var windows = []; + while (enumerator.hasMoreElements()) { + windows.push(enumerator.getNext()); + } + return windows; + }; this.getActiveZoteroPane = function() { var win = Services.wm.getMostRecentWindow("navigator:browser");