Add Zotero.getMainWindows()

This commit is contained in:
Dan Stillman 2023-08-03 05:11:26 -04:00 committed by GitHub
parent 1ca34261d3
commit 07309d7c25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -79,6 +79,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");