Skip to content

Commit

Permalink
Use nsIWindowWatcher in Zotero.openInViewer()
Browse files Browse the repository at this point in the history
Instead of getting the last browser window
  • Loading branch information
dstillman committed Jul 30, 2017
1 parent 991967d commit ee0b4f5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions chrome/content/zotero/xpcom/zotero.js
Expand Up @@ -1054,9 +1054,13 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js");
if (win) {
win.loadURI(uri);
} else {
let window = wm.getMostRecentWindow("navigator:browser");
win = window.openDialog("chrome://zotero/content/standalone/basicViewer.xul",
"basicViewer", "chrome,resizable,centerscreen,menubar,scrollbars", uri);
let ww = Components.classes['@mozilla.org/embedcomp/window-watcher;1']
.getService(Components.interfaces.nsIWindowWatcher);
let arg = Components.classes["@mozilla.org/supports-string;1"]
.createInstance(Components.interfaces.nsISupportsString);
arg.data = uri;
win = ww.openWindow(null, "chrome://zotero/content/standalone/basicViewer.xul",
"basicViewer", "chrome,dialog=yes,resizable,centerscreen,menubar,scrollbars", arg);
}
if (onLoad) {
let browser
Expand Down

0 comments on commit ee0b4f5

Please sign in to comment.