Add Zotero.getMainWindows()
This commit is contained in:
parent
1ca34261d3
commit
07309d7c25
1 changed files with 12 additions and 0 deletions
|
@ -80,6 +80,18 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js");
|
||||||
return Services.wm.getMostRecentWindow("navigator:browser");
|
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() {
|
this.getActiveZoteroPane = function() {
|
||||||
var win = Services.wm.getMostRecentWindow("navigator:browser");
|
var win = Services.wm.getMostRecentWindow("navigator:browser");
|
||||||
return win ? win.ZoteroPane : null;
|
return win ? win.ZoteroPane : null;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue