mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 872162 - Remove dead openURL function from web apps code, no longer check appOrigin in browser.js' onLocationChange, r=felipe
This commit is contained in:
parent
7f9d2174a6
commit
2ecb69a14f
@ -3746,13 +3746,6 @@ var XULBrowserWindow = {
|
||||
SocialShare.update();
|
||||
}
|
||||
|
||||
// Show or hide browser chrome for apps
|
||||
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
|
||||
if (ss.getTabValue(gBrowser.selectedTab, "appOrigin"))
|
||||
document.documentElement.setAttribute("disablechrome", "true");
|
||||
else
|
||||
document.documentElement.removeAttribute("disablechrome");
|
||||
|
||||
// Utility functions for disabling find
|
||||
var shouldDisableFind = function shouldDisableFind(aDocument) {
|
||||
let docElt = aDocument.documentElement;
|
||||
|
@ -47,45 +47,6 @@ this.webappsUI = {
|
||||
}
|
||||
},
|
||||
|
||||
openURL: function(aUrl, aOrigin) {
|
||||
let browserEnumerator = Services.wm.getEnumerator("navigator:browser");
|
||||
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
|
||||
|
||||
// Check each browser instance for our URL
|
||||
let found = false;
|
||||
while (!found && browserEnumerator.hasMoreElements()) {
|
||||
let browserWin = browserEnumerator.getNext();
|
||||
let tabbrowser = browserWin.gBrowser;
|
||||
|
||||
// Check each tab of this browser instance
|
||||
let numTabs = tabbrowser.tabs.length;
|
||||
for (let index = 0; index < numTabs; index++) {
|
||||
let tab = tabbrowser.tabs[index];
|
||||
let appURL = ss.getTabValue(tab, "appOrigin");
|
||||
if (appURL == aOrigin) {
|
||||
// The URL is already opened. Select this tab.
|
||||
tabbrowser.selectedTab = tab;
|
||||
browserWin.focus();
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Our URL isn't open. Open it now.
|
||||
if (!found) {
|
||||
let recentWindow = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
if (recentWindow) {
|
||||
// Use an existing browser window
|
||||
let browser = recentWindow.gBrowser;
|
||||
let tab = browser.addTab(aUrl);
|
||||
browser.pinTab(tab);
|
||||
browser.selectedTab = tab;
|
||||
ss.setTabValue(tab, "appOrigin", aOrigin);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_getBrowserForId: function(aId) {
|
||||
let content = Services.wm.getOuterWindowWithId(aId);
|
||||
if (content) {
|
||||
|
Loading…
Reference in New Issue
Block a user