From 1475a79cd1450a71de927550faf6e45709677a74 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 8 Mar 2012 14:32:38 -0500 Subject: [PATCH] Open csledit/cslpreview in new tab in existing window in Fx Fixes #75 --- chrome/content/zotero/preferences/preferences.js | 8 ++++++-- chrome/content/zotero/preferences/preferences.xul | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/chrome/content/zotero/preferences/preferences.js b/chrome/content/zotero/preferences/preferences.js index a1e8857d07..f08f363b01 100644 --- a/chrome/content/zotero/preferences/preferences.js +++ b/chrome/content/zotero/preferences/preferences.js @@ -1914,7 +1914,7 @@ function handleShowInPreferenceChange() { /** * Opens a URI in the basic viewer in Standalone, or a new window in Firefox */ -function openInViewer(uri) { +function openInViewer(uri, newTab) { var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); const features = "menubar=yes,toolbar=no,location=no,scrollbars,centerscreen,resizable"; @@ -1930,7 +1930,11 @@ function openInViewer(uri) { } else { var win = wm.getMostRecentWindow("navigator:browser"); if(win) { - win.open(uri, null, features); + if(newTab) { + win.gBrowser.selectedTab = win.gBrowser.addTab(uri); + } else { + win.open(uri, null, features); + } } else { var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"] diff --git a/chrome/content/zotero/preferences/preferences.xul b/chrome/content/zotero/preferences/preferences.xul index d73f0ad6dd..2058aca637 100644 --- a/chrome/content/zotero/preferences/preferences.xul +++ b/chrome/content/zotero/preferences/preferences.xul @@ -800,9 +800,9 @@ To add a new preference: -