diff --git a/suite/common/tasksOverlay.js b/suite/common/tasksOverlay.js index 03f0bcd43cff..7d39cd1eff40 100644 --- a/suite/common/tasksOverlay.js +++ b/suite/common/tasksOverlay.js @@ -224,19 +224,22 @@ function checkFocusedWindow() function toProfileManager() { - var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"] - .getService(Components.interfaces.nsIWindowWatcher); - var params = Components.classes["@mozilla.org/embedcomp/dialogparam;1"] + const wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] + .getService(Components.interfaces.nsIWindowMediator); + var promgrWin = wm.getMostRecentWindow( "mozilla:profileSelection" ); + if (promgrWin) { + promgrWin.focus(); + } else { + var params = Components.classes["@mozilla.org/embedcomp/dialogparam;1"] .createInstance(Components.interfaces.nsIDialogParamBlock); - params.SetNumberStrings(1); - params.SetString(0, "menu"); - ww.openWindow(null, // no parent - "chrome://communicator/content/profile/profileSelection.xul", - null, - "centerscreen,chrome,modal,titlebar", + params.SetNumberStrings(1); + params.SetString(0, "menu"); + window.openDialog("chrome://communicator/content/profile/profileSelection.xul", + "", + "centerscreen,chrome,titlebar", params); - + } // Here, we don't care about the result code // that was returned in the param block. }