mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 745765 - Reuse existing tab for same app launch in about:apps r=fabrice a=blocking-fennec
This commit is contained in:
parent
4fe85a41b4
commit
9a190f5f34
@ -1480,7 +1480,7 @@ nsBrowserAccess.prototype = {
|
||||
|
||||
if (newTab) {
|
||||
let parentId = -1;
|
||||
if (!isExternal) {
|
||||
if (!isExternal && aOpener) {
|
||||
let parent = BrowserApp.getTabForWindow(aOpener.top);
|
||||
if (parent)
|
||||
parentId = parent.id;
|
||||
@ -4652,20 +4652,12 @@ var WebappsUI = {
|
||||
},
|
||||
|
||||
openURL: function(aURI, aOrigin) {
|
||||
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
|
||||
let uri = Services.io.newURI(aURI, null, null);
|
||||
if (!uri)
|
||||
return;
|
||||
|
||||
let tabs = BrowserApp.tabs;
|
||||
let tab = null;
|
||||
for (let i = 0; i < tabs.length; i++) {
|
||||
let appOrigin = ss.getTabValue(tabs[i], "appOrigin");
|
||||
if (appOrigin == aOrigin)
|
||||
tab = tabs[i];
|
||||
}
|
||||
|
||||
if (tab)
|
||||
BrowserApp.selectTab(tab);
|
||||
else
|
||||
BrowserApp.addTab(aURI, { pinned: true });
|
||||
let bwin = window.QueryInterface(Ci.nsIDOMChromeWindow).browserDOMWindow;
|
||||
bwin.openURI(uri, null, Ci.nsIBrowserDOMWindow.OPEN_SWITCHTAB, Ci.nsIBrowserDOMWindow.OPEN_NEW);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user