зеркало из https://github.com/mozilla/gecko-dev.git
Bug 317811: Allow single-window-instance XULRunner applications, patch by Alex Sirota <alex@elbrus.com>, r=bsmedberg
This commit is contained in:
Родитель
f1cc76964d
Коммит
d928e6af8d
|
@ -77,6 +77,22 @@ var nsDefaultCLH = {
|
|||
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(nsIPrefBranch);
|
||||
|
||||
try {
|
||||
var singletonWindowType =
|
||||
prefs.getCharPref("toolkit.singletonWindowType");
|
||||
var windowMediator =
|
||||
Components.classes["@mozilla.org/appshell/window-mediator;1"]
|
||||
.getService(Components.interfaces.nsIWindowMediator);
|
||||
|
||||
var win = windowMediator.getMostRecentWindow(singletonWindowType);
|
||||
if (win) {
|
||||
win.focus();
|
||||
cmdLine.preventDefault = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch (e) { }
|
||||
|
||||
// if the pref is missing, ignore the exception
|
||||
try {
|
||||
var chromeURI = prefs.getCharPref("toolkit.defaultChromeURI");
|
||||
|
|
Загрузка…
Ссылка в новой задаче